Nullzero has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/108188


Change subject: Also show a warning on page deletion if a page is transcluded
......................................................................

Also show a warning on page deletion if a page is transcluded

[[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
---
M includes/Article.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/108188/1

diff --git a/includes/Article.php b/includes/Article.php
index a8cdc48..85a34db 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -1612,7 +1612,8 @@
                $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' );
                }
diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index d7b300c..11e2597 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -3034,7 +3034,7 @@
 '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.
diff --git a/languages/messages/MessagesQqq.php 
b/languages/messages/MessagesQqq.php
index 64214d2..dc7a9ec 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -5614,7 +5614,7 @@
 * $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}}',

-- 
To view, visit https://gerrit.wikimedia.org/r/108188
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8cb4956297f5d0b040e378f07fcbc43728d687c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nullzero <nullzero.f...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to