From 83d559afc58c76c54dc8241bd3ef51a1b533fe01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 9 Jun 2018 17:13:58 +0200 Subject: [PATCH] [ticket/15342] Track attachments thumbnails PHPBB3-15342 --- phpBB/phpbb/db/migration/data/v330/storage_track.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/migration/data/v330/storage_track.php b/phpBB/phpbb/db/migration/data/v330/storage_track.php index 12edc9bc3f..c3f8d128ec 100644 --- a/phpBB/phpbb/db/migration/data/v330/storage_track.php +++ b/phpBB/phpbb/db/migration/data/v330/storage_track.php @@ -84,7 +84,7 @@ class storage_track extends \phpbb\db\migration\migration /** @var storage $storage */ $storage = $this->container->get('storage.attachment'); - $sql = 'SELECT physical_filename + $sql = 'SELECT physical_filename, thumbnail FROM ' . ATTACHMENTS_TABLE; $result = $this->db->sql_query($sql); @@ -92,6 +92,11 @@ class storage_track extends \phpbb\db\migration\migration while ($row = $this->db->sql_fetchrow($result)) { $storage->track_file($row['physical_filename']); + + if($row['thumbnail'] == 1) + { + $storage->track_file('thumb_' . $row['physical_filename']); + } } $this->db->sql_freeresult($result); }