From a73d0df62a3869ca016ff42379441e6253520571 Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 5 Sep 2012 12:22:14 -0700 Subject: [PATCH] Revert "(bug 27111) Make cascading foreign repo's fetch description properly" The combination of $out->addHTML() and the super call cause action=render for File pages to have the text rendered twice. Wikis get commons descriptions via action=render, so they were showing the description text twice. This reverts commit ca13fde652e1a1a05c835219af7b014509a1c88f. Conflicts: RELEASE-NOTES-1.20 Change-Id: Ib1072fd1d109c0d6706215ccad1413dd72cb201d --- RELEASE-NOTES-1.20 | 1 - includes/ImagePage.php | 43 +++--------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index a48b81cfa0..b5892f650e 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -230,7 +230,6 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. PCRE is compiled without support for unicode properties. * (bug 30390) Suggested file name on Special:Upload should not contain illegal characters. -* (bug 27111) Cascading foreign file repos now fetch shared descriptions properly. * EXIF below sea level GPS altitude data is now shown correctly. * (bug 39284) jquery.tablesorter should not consider "."" or "?"" to be a currency. * (bug 39273) "Show changes" should not be incorrectly displayed in the Live Preview state. diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 7bbd5845ec..c7afb7636f 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -94,47 +94,10 @@ class ImagePage extends Article { /** * Handler for action=render * Include body text only; none of the image extras - * However, also include the shared description text - * so that cascading ForeignAPIRepo's work. - * - * @note This uses a div with the class "mw-shared-image-desc" - * as opposed to the id "mw-shared-image-desc" since the text - * from here may be cascadingly transcluded to other shared - * repos, and we want all ids to be unique. On normal - * view, the outermost shared description will still have - * the id. - * - * This also differs from normal view in that "shareddescriptionfollows" - * message is not shown. I was not sure if it was appropriate to - * add that message here. */ public function render() { - $out = $this->getContext()->getOutput(); - $this->loadFile(); - - $descText = $this->mPage->getFile()->getDescriptionText(); - - $out->setArticleBodyOnly( true ); - - if ( !$descText ) { - // If no description text, just do standard action=render - parent::view(); - } else { - if ( $this->mPage->getID() !== 0 ) { - // Local description exists. We need to output both - parent::view(); - $out->addHTML( '
' . $descText . "
\n" ); - } else { - // We don't want to output both a "noarticletext" message and the shared - // description, so don't call parent::view(). - $out->addHTML( '
' . $descText . "
\n" ); - // Since we did not call parent::view(), have to call some methods it - // normally takes care of. (Not that it matters much since skin not displayed) - $out->setArticleFlag( true ); - $out->setPageTitle( $this->getTitle()->getPrefixedText() ); - $this->mPage->doViewUpdates( $this->getContext()->getUser() ); - } - } + $this->getContext()->getOutput()->setArticleBodyOnly( true ); + parent::view(); } public function view() { @@ -209,7 +172,7 @@ class ImagePage extends Article { if ( !$fol->isDisabled() ) { $out->addWikiText( $fol->plain() ); } - $out->addHTML( '
' . $this->mExtraDescription . "
\n" ); + $out->addHTML( '
' . $this->mExtraDescription . "
\n" ); } $this->closeShowImage(); -- 2.20.1