diff --git a/phpBB/phpbb/db/migration/data/v400/storage_track.php b/phpBB/phpbb/db/migration/data/v400/storage_track.php index 54827d7d29..7d2b4dec20 100644 --- a/phpBB/phpbb/db/migration/data/v400/storage_track.php +++ b/phpBB/phpbb/db/migration/data/v400/storage_track.php @@ -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)