Merge "filerepo: only trigger maybeUpgradeRow() on action=purge"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 29 Mar 2019 18:00:44 +0000 (18:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 29 Mar 2019 18:00:44 +0000 (18:00 +0000)
includes/filerepo/file/LocalFile.php

index 9b9e748..134a104 100644 (file)
@@ -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