From: Brad Jorsch Date: Sun, 18 Mar 2018 15:37:05 +0000 (-0400) Subject: Move image_comment_temp entries when the file is moved X-Git-Tag: 1.31.0-rc.0~351^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=9ceb2e08a049ed60e669c4636bcb8eb5eb1d87c6;p=lhc%2Fweb%2Fwiklou.git Move image_comment_temp entries when the file is moved Bug: T189985 Change-Id: I437102d62cb94fd3195ff06ee8185ce5a2dc941e --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index ec4a5fb5f1..7fc45ebf4a 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -3374,6 +3374,8 @@ class LocalFileMoveBatch { * many rows where updated. */ protected function doDBUpdates() { + global $wgCommentTableSchemaMigrationStage; + $dbw = $this->db; // Update current image @@ -3383,6 +3385,15 @@ class LocalFileMoveBatch { [ 'img_name' => $this->oldName ], __METHOD__ ); + if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) { + $dbw->update( + 'image_comment_temp', + [ 'imgcomment_name' => $this->newName ], + [ 'imgcomment_name' => $this->oldName ], + __METHOD__ + ); + } + // Update old images $dbw->update( 'oldimage',