r103502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103501‎ | r103502 | r103503 >
Date:20:21, 17 November 2011
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
* Added WikiPage::getParserOutput() and changed Article::getParserOutput() to use it
* WikiPage::getParserOutput() requires a ParserOptions object (and optionally the revision ID) instead of an User object, removes an hidden dependency on $wgLang. For this reason, WikiPage::isParserCacheUsed() now also uses a ParserOptions object instead of an User object (doesn't change anything in the code except the variable name and it's not called in extensions)
* Moved PoolWorkArticleView to WikiPage.php and added an entry in the AutoLoader and moved output-related stuff directly in Article::view() so that in can be shared with WikiPage::getParserOutput() (removes code duplication, etc.)
* Added the revision ID to the PoolCounter key so that it knows which revision is being parsed and doesn't wait for another parse operation with same options but different revisions
* Removed Article::doViewParse(), Article::tryDirtyCache() and Article::getOutputFromWikitext() since they are now integrated in PoolWorkArticleView and Article::view() and there are no callers in extensions. This also fixes a bug since Article::doViewParse() will get another ParserOptions instance with special options set in Article::view() not be repercuted.
* Updated DifferenceEngine to use the new system
* Updated docs/memcached.txt to correct method names
Modified paths:
  • /trunk/phase3/docs/memcached.txt (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/memcached.txt
@@ -159,7 +159,7 @@
160160 $hash: hash of user options applied to the page, see ParserOptions::optionsHash()
161161 ex: wikidb:pcache:idhash:1-0!1!0!!en!2
162162 stores: ParserOutput object
163 - modified by: Article::editUpdates() or Article::getOutputFromWikitext()
 163+ modified by: WikiPage::doEditUpdates() or PoolWorkArticleView::doWork()
164164 expiry: $wgParserCacheExpireTime or less if it contains short lived functions
165165
166166 key: $wgDBname:pcache:idoptions:$pageid
Index: trunk/phase3/includes/WikiPage.php
@@ -708,21 +708,62 @@
709709 /**
710710 * Should the parser cache be used?
711711 *
712 - * @param $user User The relevant user
 712+ * @param $parserOptions ParserOptions to check
713713 * @param $oldid int
714714 * @return boolean
715715 */
716 - public function isParserCacheUsed( User $user, $oldid ) {
 716+ public function isParserCacheUsed( ParserOptions $parserOptions, $oldid ) {
717717 global $wgEnableParserCache;
718718
719719 return $wgEnableParserCache
720 - && $user->getStubThreshold() == 0
 720+ && $parserOptions->getStubThreshold() == 0
721721 && $this->exists()
722722 && ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() )
723723 && $this->mTitle->isWikitextPage();
724724 }
725725
726726 /**
 727+ * Get a ParserOutput for the given ParserOptions and revision ID.
 728+ * The the parser cache will be used if possible.
 729+ *
 730+ * @since 1.19
 731+ * @param $parserOptions ParserOptions to use for the parse operation
 732+ * @param $oldid Revision ID to get the text from, passing null or 0 will
 733+ * get the current revision (default value)
 734+ * @return ParserOutput or false if the revision was not found
 735+ */
 736+ public function getParserOutput( ParserOptions $parserOptions, $oldid = null ) {
 737+ global $wgParser;
 738+
 739+ wfProfileIn( __METHOD__ );
 740+
 741+ $useParserCache = $this->isParserCacheUsed( $parserOptions, $oldid );
 742+ wfDebug( __METHOD__ . ': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
 743+ if ( $parserOptions->getStubThreshold() ) {
 744+ wfIncrStats( 'pcache_miss_stub' );
 745+ }
 746+
 747+ if ( $useParserCache ) {
 748+ $parserOutput = ParserCache::singleton()->get( $this, $parserOptions );
 749+ if ( $parserOutput !== false ) {
 750+ wfProfileOut( __METHOD__ );
 751+ return $parserOutput;
 752+ }
 753+ }
 754+
 755+ if ( $oldid === null || $oldid === 0 ) {
 756+ $oldid = $this->getLatest();
 757+ }
 758+
 759+ $pool = new PoolWorkArticleView( $this, $parserOptions, $oldid, $useParserCache );
 760+ $pool->execute();
 761+
 762+ wfProfileOut( __METHOD__ );
 763+
 764+ return $pool->getParserOutput();
 765+ }
 766+
 767+ /**
727768 * Perform the actions of a page purging
728769 */
729770 public function doPurge() {
@@ -2671,6 +2712,183 @@
26722713 */
26732714 public function useParserCache( $oldid ) {
26742715 global $wgUser;
2675 - return $this->isParserCacheUsed( $wgUser, $oldid );
 2716+ return $this->isParserCacheUsed( ParserOptions::newFromUser( $wgUser ), $oldid );
26762717 }
26772718 }
 2719+
 2720+class PoolWorkArticleView extends PoolCounterWork {
 2721+
 2722+ /**
 2723+ * @var Page
 2724+ */
 2725+ private $page;
 2726+
 2727+ /**
 2728+ * @var string
 2729+ */
 2730+ private $cacheKey;
 2731+
 2732+ /**
 2733+ * @var integer
 2734+ */
 2735+ private $revid;
 2736+
 2737+ /**
 2738+ * @var ParserOptions
 2739+ */
 2740+ private $parserOptions;
 2741+
 2742+ /**
 2743+ * @var string|null
 2744+ */
 2745+ private $text;
 2746+
 2747+ /**
 2748+ * @var ParserOutput|false
 2749+ */
 2750+ private $parserOutput = false;
 2751+
 2752+ /**
 2753+ * @var bool
 2754+ */
 2755+ private $isDirty = false;
 2756+
 2757+ /**
 2758+ * @var Status|false
 2759+ */
 2760+ private $error = false;
 2761+
 2762+ /**
 2763+ * Constructor
 2764+ *
 2765+ * @param $page Page
 2766+ * @param $revid Integer: ID of the revision being parsed
 2767+ * @param $useParserCache Boolean: whether to use the parser cache
 2768+ * @param $parserOptions parserOptions to use for the parse operation
 2769+ * @param $text String: text to parse or null to load it
 2770+ */
 2771+ function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $text = null ) {
 2772+ $this->page = $page;
 2773+ $this->revid = $revid;
 2774+ $this->cacheable = $useParserCache;
 2775+ $this->parserOptions = $parserOptions;
 2776+ $this->text = $text;
 2777+ $this->cacheKey = ParserCache::singleton()->getKey( $page, $parserOptions );
 2778+ parent::__construct( 'ArticleView', $this->cacheKey . ':revid:' . $revid );
 2779+ }
 2780+
 2781+ /**
 2782+ * Get the ParserOutput from this object, or false in case of failure
 2783+ *
 2784+ * @return ParserOutput
 2785+ */
 2786+ public function getParserOutput() {
 2787+ return $this->parserOutput;
 2788+ }
 2789+
 2790+ /**
 2791+ * Get whether the ParserOutput is a dirty one (i.e. expired)
 2792+ *
 2793+ * @return bool
 2794+ */
 2795+ public function getIsDirty() {
 2796+ return $this->isDirty();
 2797+ }
 2798+
 2799+ /**
 2800+ * Get a Status object in case of error or false otherwise
 2801+ *
 2802+ * @return Status|false
 2803+ */
 2804+ public function getError() {
 2805+ return $this->error;
 2806+ }
 2807+
 2808+ /**
 2809+ * @return bool
 2810+ */
 2811+ function doWork() {
 2812+ global $wgParser, $wgUseFileCache;
 2813+
 2814+ $isCurrent = $this->revid === $this->page->getLatest();
 2815+
 2816+ if ( $this->text !== null ) {
 2817+ $text = $this->text;
 2818+ } elseif ( $isCurrent ) {
 2819+ $text = $this->page->getRawText();
 2820+ } else {
 2821+ $rev = Revision::newFromTitle( $this->page->getTitle(), $this->revid );
 2822+ if ( $rev === null ) {
 2823+ return false;
 2824+ }
 2825+ $text = $rev->getText();
 2826+ }
 2827+
 2828+ $time = - wfTime();
 2829+ $this->parserOutput = $wgParser->parse( $text, $this->page->getTitle(),
 2830+ $this->parserOptions, true, true, $this->revid );
 2831+ $time += wfTime();
 2832+
 2833+ # Timing hack
 2834+ if ( $time > 3 ) {
 2835+ wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time,
 2836+ $this->page->getTitle()->getPrefixedDBkey() ) );
 2837+ }
 2838+
 2839+ if ( $this->cacheable && $this->parserOutput->isCacheable() ) {
 2840+ ParserCache::singleton()->save( $this->parserOutput, $this->page, $this->parserOptions );
 2841+ }
 2842+
 2843+ // Make sure file cache is not used on uncacheable content.
 2844+ // Output that has magic words in it can still use the parser cache
 2845+ // (if enabled), though it will generally expire sooner.
 2846+ if ( !$this->parserOutput->isCacheable() || $this->parserOutput->containsOldMagic() ) {
 2847+ $wgUseFileCache = false;
 2848+ }
 2849+
 2850+ if ( $isCurrent ) {
 2851+ $this->page->doCascadeProtectionUpdates( $this->parserOutput );
 2852+ }
 2853+ }
 2854+
 2855+ /**
 2856+ * @return bool
 2857+ */
 2858+ function getCachedWork() {
 2859+ $this->parserOutput = ParserCache::singleton()->get( $this->page, $this->parserOptions );
 2860+
 2861+ if ( $this->parserOutput === false ) {
 2862+ wfDebug( __METHOD__ . ": parser cache miss\n" );
 2863+ return false;
 2864+ } else {
 2865+ wfDebug( __METHOD__ . ": parser cache hit\n" );
 2866+ return true;
 2867+ }
 2868+ }
 2869+
 2870+ /**
 2871+ * @return bool
 2872+ */
 2873+ function fallback() {
 2874+ $this->parserOutput = ParserCache::singleton()->getDirty( $this->page, $this->parserOptions );
 2875+
 2876+ if ( $this->parserOutput === false ) {
 2877+ wfDebugLog( 'dirty', "dirty missing\n" );
 2878+ wfDebug( __METHOD__ . ": no dirty cache\n" );
 2879+ return false;
 2880+ } else {
 2881+ wfDebug( __METHOD__ . ": sending dirty output\n" );
 2882+ wfDebugLog( 'dirty', "dirty output {$this->cacheKey}\n" );
 2883+ $this->isDirty = true;
 2884+ return true;
 2885+ }
 2886+ }
 2887+
 2888+ /**
 2889+ * @param $status Status
 2890+ */
 2891+ function error( $status ) {
 2892+ $this->error = $status;
 2893+ return false;
 2894+ }
 2895+}
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -516,9 +516,8 @@
517517 } elseif ( !wfRunHooks( 'ArticleViewCustom', array( $this->mNewtext, $this->mNewPage, $out ) ) ) {
518518 // Handled by extension
519519 } else {
520 - # Use the current version parser cache if applicable
 520+ // Normal page
521521 $wikiPage = WikiPage::factory( $this->mNewPage );
522 - $useParserCache = $wikiPage->isParserCacheUsed( $this->getUser(), $this->mNewid );
523522
524523 $parserOptions = ParserOptions::newFromContext( $this->getContext() );
525524 $parserOptions->enableLimitReport();
@@ -528,15 +527,11 @@
529528 $parserOptions->setEditSection( false );
530529 }
531530
532 - $parserOutput = false;
533 - if ( $useParserCache ) {
534 - $parserOutput = ParserCache::singleton()->get( $wikiPage, $parserOptions );
535 - }
 531+ $parserOutput = $wikiPage->getParserOutput( $parserOptions, $this->mNewid );
536532
 533+ # WikiPage::getParserOutput() should not return false, but just in case
537534 if( $parserOutput ) {
538535 $out->addParserOutput( $parserOutput );
539 - } else {
540 - $out->addWikiTextTidy( $this->mNewtext );
541536 }
542537 }
543538 }
Index: trunk/phase3/includes/Article.php
@@ -453,7 +453,7 @@
454454 }
455455
456456 # Should the parser cache be used?
457 - $useParserCache = $this->mPage->isParserCacheUsed( $wgUser, $oldid );
 457+ $useParserCache = $this->mPage->isParserCacheUsed( $parserOptions, $oldid );
458458 wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
459459 if ( $wgUser->getStubThreshold() ) {
460460 wfIncrStats( 'pcache_miss_stub' );
@@ -550,16 +550,34 @@
551551 # Run the parse, protected by a pool counter
552552 wfDebug( __METHOD__ . ": doing uncached parse\n" );
553553
554 - $key = $parserCache->getKey( $this, $parserOptions );
555 - $poolArticleView = new PoolWorkArticleView( $this, $key, $useParserCache, $parserOptions );
 554+ $poolArticleView = new PoolWorkArticleView( $this, $parserOptions,
 555+ $this->getRevIdFetched(), $useParserCache, $this->getContent() );
556556
557557 if ( !$poolArticleView->execute() ) {
 558+ $error = $poolArticleView->getError();
 559+ if ( $error ) {
 560+ $wgOut->clearHTML(); // for release() errors
 561+ $wgOut->enableClientCache( false );
 562+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
 563+
 564+ $errortext = $error->getWikiText( false, 'view-pool-error' );
 565+ $wgOut->addWikiText( '<div class="errorbox">' . $errortext . '</div>' );
 566+ }
558567 # Connection or timeout error
559568 wfProfileOut( __METHOD__ );
560569 return;
561 - } else {
562 - $outputDone = true;
563570 }
 571+
 572+ $this->mParserOutput = $poolArticleView->getParserOutput();
 573+ $wgOut->addParserOutput( $this->mParserOutput );
 574+
 575+ # Don't cache a dirty ParserOutput object
 576+ if ( $poolArticleView->getIsDirty() ) {
 577+ $wgOut->setSquidMaxage( 0 );
 578+ $wgOut->addHTML( "<!-- parser cache is expired, sending anyway due to pool overload-->\n" );
 579+ }
 580+
 581+ $outputDone = true;
564582 break;
565583 # Should be unreachable, but just in case...
566584 default:
@@ -1150,67 +1168,6 @@
11511169 }
11521170
11531171 /**
1154 - * Execute the uncached parse for action=view
1155 - * @return bool
1156 - */
1157 - public function doViewParse() {
1158 - global $wgOut;
1159 -
1160 - $oldid = $this->getOldID();
1161 - $parserOptions = $this->getParserOptions();
1162 -
1163 - # Render printable version, use printable version cache
1164 - $parserOptions->setIsPrintable( $wgOut->isPrintable() );
1165 -
1166 - # Don't show section-edit links on old revisions... this way lies madness.
1167 - if ( !$this->isCurrent() || $wgOut->isPrintable() || !$this->getTitle()->quickUserCan( 'edit' ) ) {
1168 - $parserOptions->setEditSection( false );
1169 - }
1170 -
1171 - $useParserCache = $this->useParserCache( $oldid );
1172 - $this->outputWikiText( $this->getContent(), $useParserCache, $parserOptions );
1173 -
1174 - return true;
1175 - }
1176 -
1177 - /**
1178 - * Try to fetch an expired entry from the parser cache. If it is present,
1179 - * output it and return true. If it is not present, output nothing and
1180 - * return false. This is used as a callback function for
1181 - * PoolCounter::executeProtected().
1182 - *
1183 - * @return boolean
1184 - */
1185 - public function tryDirtyCache() {
1186 - global $wgOut;
1187 - $parserCache = ParserCache::singleton();
1188 - $options = $this->getParserOptions();
1189 -
1190 - if ( $wgOut->isPrintable() ) {
1191 - $options->setIsPrintable( true );
1192 - $options->setEditSection( false );
1193 - }
1194 -
1195 - $output = $parserCache->getDirty( $this, $options );
1196 -
1197 - if ( $output ) {
1198 - wfDebug( __METHOD__ . ": sending dirty output\n" );
1199 - wfDebugLog( 'dirty', "dirty output " . $parserCache->getKey( $this, $options ) . "\n" );
1200 - $wgOut->setSquidMaxage( 0 );
1201 - $this->mParserOutput = $output;
1202 - $wgOut->addParserOutput( $output );
1203 - $wgOut->addHTML( "<!-- parser cache is expired, sending anyway due to pool overload-->\n" );
1204 -
1205 - return true;
1206 - } else {
1207 - wfDebugLog( 'dirty', "dirty missing\n" );
1208 - wfDebug( __METHOD__ . ": no dirty cache\n" );
1209 -
1210 - return false;
1211 - }
1212 - }
1213 -
1214 - /**
12151172 * View redirect
12161173 *
12171174 * @param $target Title|Array of destination(s) to redirect
@@ -1642,25 +1599,6 @@
16431600 /**#@-*/
16441601
16451602 /**
1646 - * Add the primary page-view wikitext to the output buffer
1647 - * Saves the text into the parser cache if possible.
1648 - * Updates templatelinks if it is out of date.
1649 - *
1650 - * @param $text String
1651 - * @param $cache Boolean
1652 - * @param $parserOptions mixed ParserOptions object, or boolean false
1653 - */
1654 - public function outputWikiText( $text, $cache = true, $parserOptions = false ) {
1655 - global $wgOut;
1656 -
1657 - $this->mParserOutput = $this->getOutputFromWikitext( $text, $cache, $parserOptions );
1658 -
1659 - $this->doCascadeProtectionUpdates( $this->mParserOutput );
1660 -
1661 - $wgOut->addParserOutput( $this->mParserOutput );
1662 - }
1663 -
1664 - /**
16651603 * Lightweight method to get the parser output for a page, checking the parser cache
16661604 * and so on. Doesn't consider most of the stuff that WikiPage::view is forced to
16671605 * consider, so it's not appropriate to use there.
@@ -1672,96 +1610,15 @@
16731611 * @return ParserOutput or false if the given revsion ID is not found
16741612 */
16751613 public function getParserOutput( $oldid = null, User $user = null ) {
1676 - global $wgEnableParserCache, $wgUser;
 1614+ global $wgUser;
 1615+
16771616 $user = is_null( $user ) ? $wgUser : $user;
 1617+ $parserOptions = $this->mPage->makeParserOptions( $user );
16781618
1679 - wfProfileIn( __METHOD__ );
1680 - // Should the parser cache be used?
1681 - $useParserCache = $wgEnableParserCache &&
1682 - $user->getStubThreshold() == 0 &&
1683 - $this->mPage->exists() &&
1684 - $oldid === null;
1685 -
1686 - wfDebug( __METHOD__ . ': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
1687 -
1688 - if ( $user->getStubThreshold() ) {
1689 - wfIncrStats( 'pcache_miss_stub' );
1690 - }
1691 -
1692 - if ( $useParserCache ) {
1693 - $options = $this->mPage->makeParserOptions( $user );
1694 - $parserOutput = ParserCache::singleton()->get( $this, $options );
1695 - if ( $parserOutput !== false ) {
1696 - wfProfileOut( __METHOD__ );
1697 - return $parserOutput;
1698 - }
1699 - }
1700 -
1701 - // Cache miss; parse and output it.
1702 - if ( $oldid === null ) {
1703 - $text = $this->mPage->getRawText();
1704 - } else {
1705 - $rev = Revision::newFromTitle( $this->getTitle(), $oldid );
1706 - if ( $rev === null ) {
1707 - wfProfileOut( __METHOD__ );
1708 - return false;
1709 - }
1710 - $text = $rev->getText();
1711 - }
1712 -
1713 - $output = $this->getOutputFromWikitext( $text, $useParserCache );
1714 - wfProfileOut( __METHOD__ );
1715 - return $output;
 1619+ return $this->mPage->getParserOutput( $parserOptions, $oldid );
17161620 }
17171621
17181622 /**
1719 - * This does all the heavy lifting for outputWikitext, except it returns the parser
1720 - * output instead of sending it straight to $wgOut. Makes things nice and simple for,
1721 - * say, embedding thread pages within a discussion system (LiquidThreads)
1722 - *
1723 - * @param $text string
1724 - * @param $cache boolean
1725 - * @param $parserOptions parsing options, defaults to false
1726 - * @return ParserOutput
1727 - */
1728 - public function getOutputFromWikitext( $text, $cache = true, $parserOptions = false ) {
1729 - global $wgParser, $wgEnableParserCache, $wgUseFileCache;
1730 -
1731 - if ( !$parserOptions ) {
1732 - $parserOptions = $this->getParserOptions();
1733 - }
1734 -
1735 - $time = - wfTime();
1736 - $this->mParserOutput = $wgParser->parse( $text, $this->getTitle(),
1737 - $parserOptions, true, true, $this->getRevIdFetched() );
1738 - $time += wfTime();
1739 -
1740 - # Timing hack
1741 - if ( $time > 3 ) {
1742 - wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time,
1743 - $this->getTitle()->getPrefixedDBkey() ) );
1744 - }
1745 -
1746 - if ( $wgEnableParserCache && $cache && $this->mParserOutput->isCacheable() ) {
1747 - $parserCache = ParserCache::singleton();
1748 - $parserCache->save( $this->mParserOutput, $this, $parserOptions );
1749 - }
1750 -
1751 - // Make sure file cache is not used on uncacheable content.
1752 - // Output that has magic words in it can still use the parser cache
1753 - // (if enabled), though it will generally expire sooner.
1754 - if ( !$this->mParserOutput->isCacheable() || $this->mParserOutput->containsOldMagic() ) {
1755 - $wgUseFileCache = false;
1756 - }
1757 -
1758 - if ( $this->isCurrent() ) {
1759 - $this->mPage->doCascadeProtectionUpdates( $this->mParserOutput );
1760 - }
1761 -
1762 - return $this->mParserOutput;
1763 - }
1764 -
1765 - /**
17661623 * Get parser options suitable for rendering the primary article wikitext
17671624 * @return ParserOptions|false
17681625 */
@@ -2063,68 +1920,3 @@
20641921 }
20651922 // ******
20661923 }
2067 -
2068 -class PoolWorkArticleView extends PoolCounterWork {
2069 -
2070 - /**
2071 - * @var Article
2072 - */
2073 - private $mArticle;
2074 -
2075 - function __construct( $article, $key, $useParserCache, $parserOptions ) {
2076 - parent::__construct( 'ArticleView', $key );
2077 - $this->mArticle = $article;
2078 - $this->cacheable = $useParserCache;
2079 - $this->parserOptions = $parserOptions;
2080 - }
2081 -
2082 - /**
2083 - * @return bool
2084 - */
2085 - function doWork() {
2086 - return $this->mArticle->doViewParse();
2087 - }
2088 -
2089 - /**
2090 - * @return bool
2091 - */
2092 - function getCachedWork() {
2093 - global $wgOut;
2094 -
2095 - $parserCache = ParserCache::singleton();
2096 - $this->mArticle->mParserOutput = $parserCache->get( $this->mArticle, $this->parserOptions );
2097 -
2098 - if ( $this->mArticle->mParserOutput !== false ) {
2099 - wfDebug( __METHOD__ . ": showing contents parsed by someone else\n" );
2100 - $wgOut->addParserOutput( $this->mArticle->mParserOutput );
2101 - # Ensure that UI elements requiring revision ID have
2102 - # the correct version information.
2103 - $wgOut->setRevisionId( $this->mArticle->getLatest() );
2104 - return true;
2105 - }
2106 - return false;
2107 - }
2108 -
2109 - /**
2110 - * @return bool
2111 - */
2112 - function fallback() {
2113 - return $this->mArticle->tryDirtyCache();
2114 - }
2115 -
2116 - /**
2117 - * @param $status Status
2118 - */
2119 - function error( $status ) {
2120 - global $wgOut;
2121 -
2122 - $wgOut->clearHTML(); // for release() errors
2123 - $wgOut->enableClientCache( false );
2124 - $wgOut->setRobotPolicy( 'noindex,nofollow' );
2125 -
2126 - $errortext = $status->getWikiText( false, 'view-pool-error' );
2127 - $wgOut->addWikiText( '<div class="errorbox">' . $errortext . '</div>' );
2128 -
2129 - return false;
2130 - }
2131 -}
Index: trunk/phase3/includes/AutoLoader.php
@@ -168,6 +168,7 @@
169169 'PoolCounter' => 'includes/PoolCounter.php',
170170 'PoolCounter_Stub' => 'includes/PoolCounter.php',
171171 'PoolCounterWork' => 'includes/PoolCounter.php',
 172+ 'PoolWorkArticleView' => 'includes/WikiPage.php',
172173 'Preferences' => 'includes/Preferences.php',
173174 'PreferencesForm' => 'includes/Preferences.php',
174175 'PrefixSearch' => 'includes/PrefixSearch.php',

Follow-up revisions

RevisionCommit summaryAuthorDate
r103579Fix for r103502: make PoolWorkArticleView::doWork() return true when the pars...ialex07:10, 18 November 2011
r113816* (bug 34841) Fix for r103502: don't show edit links when display old page ve...ialex16:04, 14 March 2012

Comments

#Comment by Raymond (talk | contribs)   22:31, 17 November 2011

Something is going wrong here... If I run this revision on Translatewiki the page content is not shown (title h1 only). But no PHP error in the log file!

#Comment by IAlex (talk | contribs)   07:10, 18 November 2011

Fixed in r103579.

#Comment by Aaron Schulz (talk | contribs)   20:00, 16 December 2011
* @return ParserOutput or false if the revision was not found

Please use "@return ParserOutput|false" for IDEs.

#Comment by MaxSem (talk | contribs)   15:52, 14 March 2012

Causes bug 34841 - Edit links seen on previous page versions.

#Comment by IAlex (talk | contribs)   16:05, 14 March 2012

Fixed in r113816.

Status & tagging log