From: Tim Starling Date: Sun, 1 Jan 2006 20:08:08 +0000 (+0000) Subject: fix for broken categories on preview X-Git-Tag: 1.6.0~819 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=426c6414412e478a345f6627b2be071d010dcaaa;p=lhc%2Fweb%2Fwiklou.git fix for broken categories on preview --- diff --git a/includes/EditPage.php b/includes/EditPage.php index a83b20a5d5..7261751fd3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1116,10 +1116,8 @@ END $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n", $wgTitle, $parserOptions ); - $previewHTML = $parserOutput->mText; - - $wgOut->addCategoryLinks($parserOutput->getCategoryLinks()); - $wgOut->addLanguageLinks($parserOutput->getLanguageLinks()); + $previewHTML = $parserOutput->getText(); + $wgOut->addParserOutputNoText( $parserOutput ); wfProfileOut( $fname ); return $previewhead . $previewHTML; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3d464f4132..9978a31799 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -286,12 +286,20 @@ class OutputPage { global $wgParser; $parserOutput = $wgParser->parse( $text, $title, $this->mParserOptions, $linestart, true, $this->mRevisionId ); + $this->addParserOutput( $parserOutput ); + } + + function addParserOutputNoText( &$parserOutput ) { $this->mLanguageLinks += $parserOutput->getLanguageLinks(); $this->addCategoryLinks( $parserOutput->getCategories() ); $this->addKeywords( $parserOutput ); if ( $parserOutput->getCacheTime() == -1 ) { $this->enableClientCache( false ); } + } + + function addParserOutput( &$parserOutput ) { + $this->addParserOutputNoText( $parserOutput ); $this->addHTML( $parserOutput->getText() ); } @@ -305,19 +313,11 @@ class OutputPage { $parserOutput = $wgParser->parse( $text, $article->mTitle, $this->mParserOptions, true, true, $this->mRevisionId ); - $text = $parserOutput->getText(); - if ( $article && $parserOutput->getCacheTime() != -1 ) { $wgParserCache->save( $parserOutput, $article, $wgUser ); } - $this->mLanguageLinks += $parserOutput->getLanguageLinks(); - $this->addCategoryLinks( $parserOutput->getCategories() ); - $this->addKeywords( $parserOutput ); - if ( $parserOutput->getCacheTime() == -1 ) { - $this->enableClientCache( false ); - } - $this->addHTML( $text ); + $this->addParserOutput( $parserOutput ); } /**