From cecf964f84052c4c4f1cb22be49f0fef4789db4a Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 2 Nov 2021 16:47:03 +1100 Subject: [PATCH] Remove on-demand update of img_sha1 This is just a migration hack that we forgot to remove after PopulateImageSha1 was added as an update stage. It's complicated to continue supporting it. Bug: T283045 Change-Id: I453b3d8ba142a3bd17535c15d3bcf4edce641b39 --- includes/filerepo/file/LocalFile.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index d792012c5b1..88f9d2302e8 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2638,23 +2638,6 @@ class LocalFile extends File { */ public function getSha1() { $this->load(); - // Initialise now if necessary - if ( $this->sha1 == '' && $this->fileExists ) { - $this->lock(); - - $this->sha1 = $this->repo->getFileSha1( $this->getPath() ); - if ( !wfReadOnly() && strval( $this->sha1 ) != '' ) { - $dbw = $this->repo->getPrimaryDB(); - $dbw->update( 'image', - [ 'img_sha1' => $this->sha1 ], - [ 'img_name' => $this->getName() ], - __METHOD__ ); - $this->invalidateCache(); - } - - $this->unlock(); - } - return $this->sha1; }