From b814245d9f3bb8e2406fea880f9aedd514454c6c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 29 Mar 2019 01:22:22 -0700 Subject: [PATCH] filerepo: only trigger maybeUpgradeRow() on action=purge Bug: T179760 Change-Id: I36ca7517702d0c2dfbcedd4d2c132cebdce7442c --- includes/filerepo/file/LocalFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 9b9e748c19..134a1045c1 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -634,7 +634,6 @@ class LocalFile extends File { } $this->fileExists = true; - $this->maybeUpgradeRow(); } /** @@ -659,7 +658,7 @@ class LocalFile extends File { /** * Upgrade a row if it needs it */ - function maybeUpgradeRow() { + protected function maybeUpgradeRow() { global $wgUpdateCompatibleMetadata; if ( wfReadOnly() || $this->upgrading ) { @@ -1028,6 +1027,7 @@ class LocalFile extends File { */ function purgeCache( $options = [] ) { // Refresh metadata cache + $this->maybeUpgradeRow(); $this->purgeMetadataCache(); // Delete thumbnails -- 2.20.1