From 4c7436e32852a0f36481e82aa1446cd2f5e79397 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 8 Mar 2016 02:00:34 +0100 Subject: [PATCH] Match empty on "" and not just NULL --- scripts/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.php b/scripts/upgrade.php index d5178e109a..c9fe4b0817 100755 --- a/scripts/upgrade.php +++ b/scripts/upgrade.php @@ -457,7 +457,7 @@ function deleteLocalFileThumbnailsWithoutFilename() while ($file->fetch()) { $thumbs = new File_thumbnail(); $thumbs->file_id = $file->id; - $thumbs->whereAdd('filename IS NULL'); + $thumbs->whereAdd('filename IS NULL OR filename = ""'); // Checking if there were any File_thumbnail entries without filename if (!$thumbs->find()) { continue; @@ -480,7 +480,7 @@ function deleteMissingLocalFileThumbnails() printfnq("Removing all local File_thumbnail entries without existing files..."); $thumbs = new File_thumbnail(); - $thumbs->whereAdd('filename IS NOT NULL'); // only fill in names where they're missing + $thumbs->whereAdd('filename IS NOT NULL AND filename != ""'); // Checking if there were any File_thumbnail entries without filename if ($thumbs->find()) { while ($thumbs->fetch()) { -- 2.39.5