From 2b03373aaacb887bdefe891295c372aa19238960 Mon Sep 17 00:00:00 2001 From: Sorawee Porncharoenwase Date: Sat, 18 Jan 2014 08:09:09 +0700 Subject: [PATCH] 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 --- includes/Article.php | 3 ++- languages/messages/MessagesEn.php | 2 +- languages/messages/MessagesQqq.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index a8cdc48ecd..85a34dba37 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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( "\n", 'deleting-backlinks-warning' ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d7b300cace..11e259798d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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. diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 64214d2d8b..dc7a9ec8a1 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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}}', -- 2.20.1