diff options
Diffstat (limited to 'MLEB/Translate/tag/TranslateDeleteJob.php')
-rw-r--r-- | MLEB/Translate/tag/TranslateDeleteJob.php | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/MLEB/Translate/tag/TranslateDeleteJob.php b/MLEB/Translate/tag/TranslateDeleteJob.php index 38d32f89..a25e38d4 100644 --- a/MLEB/Translate/tag/TranslateDeleteJob.php +++ b/MLEB/Translate/tag/TranslateDeleteJob.php @@ -8,6 +8,8 @@ * @license GPL-2.0-or-later */ +use MediaWiki\Extensions\Translate\SystemUsers\FuzzyBot; + /** * Contains class with job for deleting translatable and translation pages. * @@ -22,7 +24,7 @@ class TranslateDeleteJob extends Job { * @param string $reason * @return self */ - public static function newJob( Title $target, $base, $full, /*User*/$performer, $reason ) { + public static function newJob( Title $target, $base, $full, /*User*/ $performer, $reason ) { $job = new self( $target ); $job->setUser( FuzzyBot::getUser() ); $job->setFull( $full ); @@ -58,8 +60,32 @@ class TranslateDeleteJob extends Job { $error = ''; $wikipage = new WikiPage( $title ); - $status = $wikipage->doDeleteArticleReal( "{$summary}: $reason", false, 0, true, $error, - $user, [], 'delete', true ); + if ( version_compare( MW_VERSION, '1.35', '<' ) ) { + $status = $wikipage->doDeleteArticleReal( + "{$summary}: $reason", + false, + 0, + true, + $error, + $user, + [], + 'delete', + true + ); + } else { + $status = $wikipage->doDeleteArticleReal( + "{$summary}: $reason", + $user, + false, + null, + $error, + null, + [], + 'delete', + true + ); + } + if ( !$status->isGood() ) { $params = [ 'target' => $base, @@ -93,7 +119,7 @@ class TranslateDeleteJob extends Job { $entry->publish( $logid ); $tpage = TranslatablePage::newFromTitle( $title ); - $tpage->getTranslationPercentages( true ); + $tpage->getTranslationPercentages(); foreach ( $tpage->getTranslationPages() as $page ) { $page->invalidateCache(); } |