Merge "Show a warning on page deletion if a page is linked to"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 30 Dec 2013 17:18:19 +0000 (17:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 30 Dec 2013 17:18:19 +0000 (17:18 +0000)
includes/Article.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index a694daf..c82b39f 100644 (file)
@@ -1611,6 +1611,10 @@ class Article implements Page {
                $outputPage->setPageTitle( wfMessage( 'delete-confirm', $this->getTitle()->getPrefixedText() ) );
                $outputPage->addBacklinkSubtitle( $this->getTitle() );
                $outputPage->setRobotPolicy( 'noindex,nofollow' );
+               if ( $this->getTitle()->getBacklinkCache()->hasLinks( 'pagelinks' ) ) {
+                       $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
+                               'deleting-backlinks-warning' );
+               }
                $outputPage->addWikiMsg( 'confirmdeletetext' );
 
                wfRunHooks( 'ArticleConfirmDelete', array( $this, $outputPage, &$reason ) );
index f645531..344e234 100644 (file)
@@ -3026,6 +3026,7 @@ Feedback and further assistance:
 'historywarning'         => "'''Warning:''' The page you are about to delete has a history with approximately $1 {{PLURAL:$1|revision|revisions}}:",
 'confirmdeletetext'      => 'You are about to delete a page along with all of its history.
 Please confirm that you intend to do this, that you understand the consequences, and that you are doing this in accordance with [[{{MediaWiki:Policy-url}}|the policy]].',
+'deleting-backlinks-warning' => "'''Warning:''' Other pages link to the page you are about to delete.",
 'actioncomplete'         => 'Action complete',
 'actionfailed'           => 'Action failed',
 'deletedtext'            => '"$1" has been deleted.
index fff02e3..94211f8 100644 (file)
@@ -5553,6 +5553,7 @@ Parameters:
 'confirmdeletetext' => 'Introduction shown when deleting a page.
 
 Refers to {{msg-mw|Policy-url}}.',
+'deleting-backlinks-warning' => "A warning shown when a page that is being deleted has links to it.",
 'actioncomplete' => 'Used in several situations, for example when a page has been deleted.
 
 See also:
@@ -10040,7 +10041,7 @@ See also:
 'specialpages-group-media' => '{{doc-special-group|like=[[Special:FilePath]], [[Special:MIMESearch]] and [[Special:Upload]]}}',
 'specialpages-group-users' => '{{doc-special-group|like=[[Special:ActiveUsers]], [[Special:Contributions]] and [[Special:ListGroupRights]]}}',
 'specialpages-group-highuse' => '{{doc-special-group|like=[[Special:MostCategories]], [[Special:MostLinked]] and [[Special:MostRevisions]]}}',
-'specialpages-group-pages' => '{{doc-special-group|like=[[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Categories]], 
+'specialpages-group-pages' => '{{doc-special-group|like=[[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Categories]],
 [[Special:Disambiguations]], etc}}',
 'specialpages-group-pagetools' => '{{doc-special-group|like=[[Special:MovePage]], [[Special:Undelete]], [[Special:WhatLinksHere]], [[Special:Export]] etc}}',
 'specialpages-group-wiki' => '{{doc-special-group|like=[[Special:Version]], [[Special:Statistics]], [[Special:LockDB]], etc}}',
index 5e463b2..2af682e 100644 (file)
@@ -2061,6 +2061,7 @@ $wgMessageStructure = array(
                'delete-edit-reasonlist',
                'delete-toobig',
                'delete-warning-toobig',
+               'deleting-backlinks-warning',
        ),
        'rollback' => array(
                'rollback',