mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-24 06:43:35 +00:00
Use MovePageFactory to instance MovePage
Constructor is deprecated MovePageFactory since 1.35 Change-Id: Iefec53267f6ed4a179f537adb67d744b3b47ea2b
This commit is contained in:
parent
4a0a3e9c5d
commit
f8f8dfca4a
|
@ -10,7 +10,7 @@
|
|||
"descriptionmsg": "replacetext-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.34.0"
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
},
|
||||
"type": "specialpage",
|
||||
"GroupPermissions": {
|
||||
|
|
|
@ -23,7 +23,6 @@ namespace MediaWiki\Extension\ReplaceText;
|
|||
|
||||
use Job as JobParent;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MovePage;
|
||||
use RequestContext;
|
||||
use Title;
|
||||
use User;
|
||||
|
@ -89,7 +88,7 @@ class Job extends JobParent {
|
|||
|
||||
$reason = $this->params['edit_summary'];
|
||||
$create_redirect = $this->params['create_redirect'];
|
||||
$mvPage = new MovePage( $this->title, $new_title );
|
||||
$mvPage = MediaWikiServices::getInstance()->getMovePageFactory()->newMovePage( $this->title, $new_title );
|
||||
$mvStatus = $mvPage->move( $current_user, $reason, $create_redirect );
|
||||
if ( !$mvStatus->isOK() ) {
|
||||
$this->error = "replaceText: error while moving: " . $this->title->getPrefixedDBkey() .
|
||||
|
|
|
@ -23,7 +23,6 @@ use ErrorPageError;
|
|||
use Html;
|
||||
use JobQueueGroup;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MovePage;
|
||||
use OOUI;
|
||||
use PermissionsError;
|
||||
use SpecialPage;
|
||||
|
@ -347,6 +346,7 @@ class SpecialReplaceText extends SpecialPage {
|
|||
$this->use_regex
|
||||
);
|
||||
|
||||
$movePageFactory = MediaWikiServices::getInstance()->getMovePageFactory();
|
||||
foreach ( $res as $row ) {
|
||||
$title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
|
||||
if ( $title == null ) {
|
||||
|
@ -360,7 +360,7 @@ class SpecialReplaceText extends SpecialPage {
|
|||
$this->use_regex
|
||||
);
|
||||
|
||||
$mvPage = new MovePage( $title, $new_title );
|
||||
$mvPage = $movePageFactory->newMovePage( $title, $new_title );
|
||||
$moveStatus = $mvPage->isValidMove();
|
||||
$permissionStatus = $mvPage->checkPermissions( $this->getUser(), null );
|
||||
|
||||
|
|
Loading…
Reference in a new issue