1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-05 12:13:23 +02:00

Merge pull request #6857 from Derky/ticket/17548

[ticket/17548] Suppress filesize errors and add DISTINCT to storage_track migration
This commit is contained in:
Marc Alexander
2025-09-26 19:07:13 +02:00
committed by GitHub

View File

@@ -75,7 +75,7 @@ class storage_track extends container_aware_migration
/** @var file_tracker $file_tracker */
$file_tracker = $this->container->get('storage.file_tracker');
$sql = 'SELECT user_avatar
$sql = 'SELECT DISTINCT user_avatar
FROM ' . USERS_TABLE . "
WHERE user_avatar_type = 'avatar.driver.upload'";
$result = $this->db->sql_query($sql);
@@ -121,7 +121,7 @@ class storage_track extends container_aware_migration
/** @var file_tracker $file_tracker */
$file_tracker = $this->container->get('storage.file_tracker');
$sql = 'SELECT physical_filename, thumbnail
$sql = 'SELECT DISTINCT physical_filename, thumbnail
FROM ' . ATTACHMENTS_TABLE;
$result = $this->db->sql_query($sql);
@@ -130,14 +130,14 @@ class storage_track extends container_aware_migration
{
$files[] = [
'file_path' => $row['physical_filename'],
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/' . $row['physical_filename']),
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/' . $row['physical_filename']),
];
if ($row['thumbnail'] == 1)
{
$files[] = [
'file_path' => 'thumb_' . $row['physical_filename'],
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/thumb_' . $row['physical_filename']),
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/thumb_' . $row['physical_filename']),
];
}
@@ -161,7 +161,7 @@ class storage_track extends container_aware_migration
/** @var file_tracker $file_tracker */
$file_tracker = $this->container->get('storage.file_tracker');
$sql = 'SELECT filename
$sql = 'SELECT DISTINCT filename
FROM ' . BACKUPS_TABLE;
$result = $this->db->sql_query($sql);
@@ -170,7 +170,7 @@ class storage_track extends container_aware_migration
{
$files[] = [
'file_path' => $row['filename'],
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\backup\\config\\path'] . '/' . $row['filename']),
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\backup\\config\\path'] . '/' . $row['filename']),
];
if (count($files) >= self::BATCH_SIZE)