aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDannyS712 <DannyS712.enwiki@gmail.com>2019-10-15 20:52:30 +0000
committerDannyS712 <DannyS712.enwiki@gmail.com>2019-12-20 00:09:45 +0000
commit4dd30a93c885daa289b7c89154f9232dc08e4ab7 (patch)
treed4f99f27c2b025df2a6d79891f6ea85c69f5d7f6
parentd0ccf7fb25d26b4e609c9e385cc028b2afc8991e (diff)
downloadmediawikicore-4dd30a93c885daa289b7c89154f9232dc08e4ab7.tar.gz
mediawikicore-4dd30a93c885daa289b7c89154f9232dc08e4ab7.zip
Add target page as a parameter to `articleexists` message
Bug: T184357 Change-Id: I350d9a8f1504ca878992340db3dd0d60f73594bd
-rw-r--r--includes/MovePage.php2
-rw-r--r--languages/i18n/en.json2
-rw-r--r--languages/i18n/qqq.json2
-rw-r--r--tests/phpunit/includes/MovePageTest.php4
-rw-r--r--tests/phpunit/includes/api/ApiMoveTest.php4
5 files changed, 7 insertions, 7 deletions
diff --git a/includes/MovePage.php b/includes/MovePage.php
index 3955d3f18d24..9e2398e002db 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -169,7 +169,7 @@ class MovePage {
// The move is allowed only if (1) the target doesn't exist, or (2) the target is a
// redirect to the source, and has no history (so we can undo bad moves right after
// they're done).
- $status->fatal( 'articleexists' );
+ $status->fatal( 'articleexists', $this->newTitle->getPrefixedText() );
}
// @todo If the old title is invalid, maybe we should check if it somehow exists in the
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index e73f28bc9d09..6fb928d73732 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2807,7 +2807,7 @@
"movepage-moved-redirect": "A redirect has been created.",
"movepage-moved-noredirect": "The creation of a redirect has been suppressed.",
"movepage-delete-first": "The target page has too many revisions to delete as part of a page move. Please first delete the page manually, then try again.",
- "articleexists": "A page of that name already exists, or the name you have chosen is not valid.\nPlease choose another name.",
+ "articleexists": "A page already exists at [[:$1]], or the page name you have chosen is not valid.\nPlease choose another name.",
"cantmove-titleprotected": "You cannot move a page to this location because the new title has been protected from creation.",
"movetalk": "Move associated talk page",
"move-subpages": "Move subpages (up to $1)",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index b1521fa39838..879855e47e16 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -3019,7 +3019,7 @@
"movepage-moved-redirect": "See also:\n* {{msg-mw|Movepage-moved}}\n* {{msg-mw|Movepage-moved-noredirect}}",
"movepage-moved-noredirect": "The message is shown after pagemove if checkbox \"{{int:move-leave-redirect}}\" was unselected before moving.\n\nSee also:\n* {{msg-mw|Movepage-moved}}\n* {{msg-mw|Movepage-moved-redirect}}",
"movepage-delete-first": "Error message shown when trying to move a page and delete the existing page by that name, but the existing page has too many revisions.",
- "articleexists": "Used as error message when moving a page.\n\nSee also:\n* {{msg-mw|Badarticleerror}}\n* {{msg-mw|Bad-target-model}}",
+ "articleexists": "Used as error message when moving a page. Parameters:\n* $1 - target page title\n\nSee also:\n* {{msg-mw|Badarticleerror}}\n* {{msg-mw|Bad-target-model}}",
"cantmove-titleprotected": "Used as error message when moving a page.",
"movetalk": "The text of the checkbox to watch the associated talk page to the page you are moving. This only appears when the talk page is not empty. Used in [[Special:MovePage]].\n\nSee also:\n* {{msg-mw|Move-page-legend|legend for the form}}\n* {{msg-mw|newtitle|label for new title}}\n* {{msg-mw|Movereason|label for textarea}}\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}}",
"move-subpages": "The text of an option on the special page [[Special:MovePage|MovePage]]. If this option is ticked, any subpages will be moved with the main page to a new title.\n\nParameters:\n* $1 - ...\nSee also:\n* {{msg-mw|Move-page-legend|legend for the form}}\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-talk-subpages|label for checkbox}}\n* {{msg-mw|Move-watch|label for checkbox}}",
diff --git a/tests/phpunit/includes/MovePageTest.php b/tests/phpunit/includes/MovePageTest.php
index 56828518674a..cadcb479609c 100644
--- a/tests/phpunit/includes/MovePageTest.php
+++ b/tests/phpunit/includes/MovePageTest.php
@@ -248,7 +248,7 @@ class MovePageTest extends MediaWikiTestCase {
'Move over existing' => [
'Existent',
'Existent2',
- [ [ 'articleexists' ] ],
+ [ [ 'articleexists', 'Existent2' ] ],
],
'Move from another wiki' => [
Title::makeTitle( NS_MAIN, 'Test', '', 'otherwiki' ),
@@ -304,7 +304,7 @@ class MovePageTest extends MediaWikiTestCase {
'Existing file to existing file' => [
'File:Existent.jpg',
'File:Existent2.jpg',
- [ [ 'articleexists' ] ],
+ [ [ 'articleexists', 'File:Existent2.jpg' ] ],
],
'Existing file to existing file with no page' => [
'File:Existent.jpg',
diff --git a/tests/phpunit/includes/api/ApiMoveTest.php b/tests/phpunit/includes/api/ApiMoveTest.php
index 22d0f3d487eb..a324de1f59a6 100644
--- a/tests/phpunit/includes/api/ApiMoveTest.php
+++ b/tests/phpunit/includes/api/ApiMoveTest.php
@@ -287,7 +287,7 @@ class ApiMoveTest extends ApiTestCase {
Title::newFromText( "Talk:$name 2" )->getArticleID() );
$this->assertSame( [ [
'message' => 'articleexists',
- 'params' => [],
+ 'params' => [ "Talk:$name 2" ],
'code' => 'articleexists',
'type' => 'error',
] ], $res[0]['move']['talkmove-errors'] );
@@ -328,7 +328,7 @@ class ApiMoveTest extends ApiTestCase {
if ( $arr['from'] === "$name/error" ) {
$this->assertSame( [ [
'message' => 'articleexists',
- 'params' => [],
+ 'params' => [ "$name 2/error" ],
'code' => 'articleexists',
'type' => 'error'
] ], $arr['errors'] );