From: Aryeh Gregor Date: Fri, 17 Nov 2006 03:16:18 +0000 (+0000) Subject: (bug 7918) "Templates used on this page" changes during preview to reflect any added... X-Git-Tag: 1.31.0-rc.0~55167 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=bc191fdb43b09875869defbe6b81a72fb93c882d;p=lhc%2Fweb%2Fwiklou.git (bug 7918) "Templates used on this page" changes during preview to reflect any added or removed templates. Patch by Mark Haidar. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e841e8fd14..b55523a3a0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -195,6 +195,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 4178) MediaWiki:Common.js will now be included for all users if $wgUseSiteJs is enabled, in addition to (if applicable) MediaWiki:Monobook.js and user JS subpages. +* (bug 7918) "Templates used on this page" changes during preview to reflect + any added or removed templates. == Languages updated == diff --git a/includes/EditPage.php b/includes/EditPage.php index 30cb2818be..76567eaf5b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -32,6 +32,7 @@ class EditPage { var $allowBlankSummary = false; var $autoSumm = ''; var $hookError = ''; + var $mPreviewTemplates; # Form values var $save = false, $preview = false, $diff = false; @@ -1268,7 +1269,7 @@ END $sk =& $wgUser->getSkin(); $outText = ''; - $templates = $this->mArticle->getUsedTemplates(); + $templates = ( $this->preview ? $this->mPreviewTemplates : $this->mArticle->getUsedTemplates() ); if ( count( $templates ) > 0 ) { # Do a batch existence check $batch = new LinkBatch; @@ -1279,7 +1280,7 @@ END # Construct the HTML $outText = '
' . - wfMsgExt( 'templatesused', array( 'parse' ) ) . + wfMsgExt( ( $this->preview ? 'templatesusedpreview' : 'templatesused' ), array( 'parse' ) ) . '