Also show a warning on page deletion if a page is transcluded
authorSorawee Porncharoenwase <nullzero.free@gmail.com>
Sat, 18 Jan 2014 01:09:09 +0000 (08:09 +0700)
committerSorawee Porncharoenwase <nullzero.free@gmail.com>
Sat, 18 Jan 2014 01:18:50 +0000 (08:18 +0700)
[[gerrit:65162]] warns on page deletion if a page which is about to delete
has at least one link to it. This patch improves the previous patch to
warn if at least one page transcludes the deleting page.

Change-Id: If8cb4956297f5d0b040e378f07fcbc43728d687c

includes/Article.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php

index a8cdc48..85a34db 100644 (file)
@@ -1612,7 +1612,8 @@ 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' ) ) {
+               $backlinkCache = $this->getTitle()->getBacklinkCache();
+               if ( $backlinkCache->hasLinks( 'pagelinks' ) || $backlinkCache->hasLinks( 'templatelinks' ) ) {
                        $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
                                'deleting-backlinks-warning' );
                }
index d7b300c..11e2597 100644 (file)
@@ -3034,7 +3034,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.",
+'deleting-backlinks-warning' => "'''Warning:''' Other pages link to or transclude from the page you are about to delete.",
 'actioncomplete'         => 'Action complete',
 'actionfailed'           => 'Action failed',
 'deletedtext'            => '"$1" has been deleted.
index 64214d2..dc7a9ec 100644 (file)
@@ -5614,7 +5614,7 @@ See also:
 * $1 - the upper limit of number of revisions
 See also:
 * {{msg-mw|Delete-toobig}}',
-'deleting-backlinks-warning' => 'A warning shown when a page that is being deleted has links to it.',
+'deleting-backlinks-warning' => 'A warning shown when a page that is being deleted has at least one link to it or is transcluded in at least one page.',
 
 # Rollback
 'rollback' => '{{Identical|Rollback}}',