From: Fomafix Date: Sat, 18 Aug 2018 15:32:48 +0000 (+0200) Subject: Replace "Bug37714" by "T39714" X-Git-Tag: 1.34.0-rc.0~4293^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=90acd0edea42c60a9251bdb363e7c8bc57be60a9;p=lhc%2Fweb%2Fwiklou.git Replace "Bug37714" by "T39714" Change-Id: I7951b24d08fb5257c8e7a52fa5f8f45b6631b979 --- diff --git a/autoload.php b/autoload.php index a372dd19f0..f914474ee4 100644 --- a/autoload.php +++ b/autoload.php @@ -1480,7 +1480,7 @@ $wgAutoloadLocalClasses = [ 'ThrottledError' => __DIR__ . '/includes/exception/ThrottledError.php', 'ThumbnailImage' => __DIR__ . '/includes/media/MediaTransformOutput.php', 'ThumbnailRenderJob' => __DIR__ . '/includes/jobqueue/jobs/ThumbnailRenderJob.php', - 'TidyUpBug37714' => __DIR__ . '/maintenance/tidyUpBug37714.php', + 'TidyUpT39714' => __DIR__ . '/maintenance/tidyUpT39714.php', 'TiffHandler' => __DIR__ . '/includes/media/TiffHandler.php', 'Timing' => __DIR__ . '/includes/libs/Timing.php', 'Title' => __DIR__ . '/includes/Title.php', diff --git a/maintenance/tidyUpBug37714.php b/maintenance/tidyUpBug37714.php deleted file mode 100644 index 0dd0341d3c..0000000000 --- a/maintenance/tidyUpBug37714.php +++ /dev/null @@ -1,48 +0,0 @@ -getDB( DB_REPLICA )->select( - 'logging', - [ 'log_id', 'log_params' ], - [ - 'log_type' => [ 'suppress', 'delete' ], - 'log_action' => 'event', - 'log_namespace' => NS_SPECIAL, - 'log_title' => SpecialPage::getTitleFor( 'Log' )->getText() - ], - __METHOD__ - ); - - foreach ( $result as $row ) { - $ids = explode( ',', explode( "\n", $row->log_params )[0] ); - $result = $this->getDB( DB_REPLICA )->select( // Work out what log entries were changed here. - 'logging', - 'log_type', - [ 'log_id' => $ids ], - __METHOD__, - 'DISTINCT' - ); - if ( $result->numRows() === 1 ) { - // If there's only one type, the target title can be set to include it. - $logTitle = SpecialPage::getTitleFor( 'Log', $result->current()->log_type )->getText(); - $this->output( 'Set log_title to "' . $logTitle . '" for log entry ' . $row->log_id . ".\n" ); - $this->getDB( DB_MASTER )->update( - 'logging', - [ 'log_title' => $logTitle ], - [ 'log_id' => $row->log_id ], - __METHOD__ - ); - wfWaitForSlaves(); - } - } - } -} - -$maintClass = TidyUpBug37714::class; -require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/tidyUpT39714.php b/maintenance/tidyUpT39714.php new file mode 100644 index 0000000000..9dacdaaa2a --- /dev/null +++ b/maintenance/tidyUpT39714.php @@ -0,0 +1,48 @@ +getDB( DB_REPLICA )->select( + 'logging', + [ 'log_id', 'log_params' ], + [ + 'log_type' => [ 'suppress', 'delete' ], + 'log_action' => 'event', + 'log_namespace' => NS_SPECIAL, + 'log_title' => SpecialPage::getTitleFor( 'Log' )->getText() + ], + __METHOD__ + ); + + foreach ( $result as $row ) { + $ids = explode( ',', explode( "\n", $row->log_params )[0] ); + $result = $this->getDB( DB_REPLICA )->select( // Work out what log entries were changed here. + 'logging', + 'log_type', + [ 'log_id' => $ids ], + __METHOD__, + 'DISTINCT' + ); + if ( $result->numRows() === 1 ) { + // If there's only one type, the target title can be set to include it. + $logTitle = SpecialPage::getTitleFor( 'Log', $result->current()->log_type )->getText(); + $this->output( 'Set log_title to "' . $logTitle . '" for log entry ' . $row->log_id . ".\n" ); + $this->getDB( DB_MASTER )->update( + 'logging', + [ 'log_title' => $logTitle ], + [ 'log_id' => $row->log_id ], + __METHOD__ + ); + wfWaitForSlaves(); + } + } + } +} + +$maintClass = TidyUpT39714::class; +require_once RUN_MAINTENANCE_IF_MAIN;