Some content models don't support redirects; when moving a page with a content model that doesn't support redirects, the note that "The old title will become a redirect page to the new title." should not be shown.
Bug: T216900
Change-Id: I70b33859a3da881d411929cf829edd2981854cbb
$out->addModules( 'mediawiki.misc-authed-ooui' );
$this->addHelpLink( 'Help:Moving a page' );
- $out->addWikiMsg( $this->getConfig()->get( 'FixDoubleRedirects' ) ?
- 'movepagetext' :
- 'movepagetext-noredirectfixer'
- );
+ $handlerSupportsRedirects = ContentHandler::getForTitle( $this->oldTitle )
+ ->supportsRedirects();
+
+ if ( $this->getConfig()->get( 'FixDoubleRedirects' ) ) {
+ $out->addWikiMsg( 'movepagetext' );
+ } else {
+ $out->addWikiMsg( $handlerSupportsRedirects ?
+ 'movepagetext-noredirectfixer' :
+ 'movepagetext-noredirectsupport' );
+ }
if ( $this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
$out->wrapWikiMsg(
}
}
- $handler = ContentHandler::getForTitle( $this->oldTitle );
-
$out->enableOOUI();
$fields = [];
}
if ( $user->isAllowed( 'suppressredirect' ) ) {
- if ( $handler->supportsRedirects() ) {
+ if ( $handlerSupportsRedirects ) {
$isChecked = $this->leaveRedirect;
$isDisabled = false;
} else {
"move-page-legend": "Move page",
"movepagetext": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nYou can update redirects that point to the original title automatically.\nIf you choose not to, be sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless the latter is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Note:</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
"movepagetext-noredirectfixer": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nBe sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless it is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Note:</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
+ "movepagetext-noredirectsupport": "Using the form below will rename a page, moving all of its history to the new name.\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Note:</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
"movepagetalktext": "If you check this box, the associated talk page will be automatically moved to new title, unless a non-empty talk page already exists there.\n\nIn this case, you will have to move or merge the page manually if desired.",
"moveuserpage-warning": "<strong>Warning:</strong> You are about to move a user page. Please note that only the page will be moved and the user will <em>not</em> be renamed.",
"movecategorypage-warning": "<strong>Warning:</strong> You are about to move a category page. Please note that only the page will be moved and any pages in the old category will <em>not</em> be recategorized into the new one.",
"move-page-legend": "Legend of the fieldset around the input form of [[Special:MovePage/testpage]].\n\nSee also:\n* {{msg-mw|newtitle|label for new title}}\n* {{msg-mw|movereason|label for textarea}}\n* {{msg-mw|movetalk|label for checkbox}}\n* {{msg-mw|move-leave-redirect|label for checkbox}}\n* {{msg-mw|fix-double-redirects|label for checkbox}}\n* {{msg-mw|move-subpages|label for checkbox}}\n* {{msg-mw|move-talk-subpages|label for checkbox}}\n* {{msg-mw|move-watch|label for checkbox}}\n{{Identical|Move page}}",
"movepagetext": "Introduction shown when moving a page ([[Special:MovePage]]).\n\nSpecial pages mentioned: {{msg-mw|Doubleredirects}}, {{msg-mw|Brokenredirects}}\n\nSee also:\n* {{msg-mw|Movepagetext-noredirectfixer}}",
"movepagetext-noredirectfixer": "A variant of the following message ''Movepagetext'' displayed when the automatic redirect fixer is not enabled.\n\nSpecial pages mentioned: {{msg-mw|Doubleredirects}}, {{msg-mw|Brokenredirects}}\n\nSee also:\n* {{msg-mw|Movepagetext}}",
+ "movepagetext-noredirectsupport": "A variant of the following message ''Movepagetext'' displayed when the content model of the page being moved does not support redirects.\n\nSee also:\n* {{msg-mw|Movepagetext}}",
"movepagetalktext": "Text on the special 'Move page'. This text only appears if the talk page is not empty.",
"moveuserpage-warning": "Used as warning in [[Special:MovePage]], when moving a user page.",
"movecategorypage-warning": "Used as warning in [[Special:MovePage]], when moving a category page.",