r12337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12336‎ | r12337 | r12338 >
Date:20:08, 1 January 2006
Author:timstarling
Status:old
Tags:
Comment:
fix for broken categories on preview
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1116,11 +1116,9 @@
11171117 $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
11181118 $wgTitle, $parserOptions );
11191119
1120 - $previewHTML = $parserOutput->mText;
 1120+ $previewHTML = $parserOutput->getText();
 1121+ $wgOut->addParserOutputNoText( $parserOutput );
11211122
1122 - $wgOut->addCategoryLinks($parserOutput->getCategoryLinks());
1123 - $wgOut->addLanguageLinks($parserOutput->getLanguageLinks());
1124 -
11251123 wfProfileOut( $fname );
11261124 return $previewhead . $previewHTML;
11271125 }
Index: trunk/phase3/includes/OutputPage.php
@@ -286,12 +286,20 @@
287287 global $wgParser;
288288 $parserOutput = $wgParser->parse( $text, $title, $this->mParserOptions,
289289 $linestart, true, $this->mRevisionId );
 290+ $this->addParserOutput( $parserOutput );
 291+ }
 292+
 293+ function addParserOutputNoText( &$parserOutput ) {
290294 $this->mLanguageLinks += $parserOutput->getLanguageLinks();
291295 $this->addCategoryLinks( $parserOutput->getCategories() );
292296 $this->addKeywords( $parserOutput );
293297 if ( $parserOutput->getCacheTime() == -1 ) {
294298 $this->enableClientCache( false );
295299 }
 300+ }
 301+
 302+ function addParserOutput( &$parserOutput ) {
 303+ $this->addParserOutputNoText( $parserOutput );
296304 $this->addHTML( $parserOutput->getText() );
297305 }
298306
@@ -305,19 +313,11 @@
306314 $parserOutput = $wgParser->parse( $text, $article->mTitle,
307315 $this->mParserOptions, true, true, $this->mRevisionId );
308316
309 - $text = $parserOutput->getText();
310 -
311317 if ( $article && $parserOutput->getCacheTime() != -1 ) {
312318 $wgParserCache->save( $parserOutput, $article, $wgUser );
313319 }
314320
315 - $this->mLanguageLinks += $parserOutput->getLanguageLinks();
316 - $this->addCategoryLinks( $parserOutput->getCategories() );
317 - $this->addKeywords( $parserOutput );
318 - if ( $parserOutput->getCacheTime() == -1 ) {
319 - $this->enableClientCache( false );
320 - }
321 - $this->addHTML( $text );
 321+ $this->addParserOutput( $parserOutput );
322322 }
323323
324324 /**

Status & tagging log