From: Alexandre Emsenhuber Date: Sat, 10 Nov 2012 15:29:56 +0000 (+0100) Subject: * (bug 41966) Follow-up I551a90b0 (c2172d4): fix fatal error in PoolWorkArticleView... X-Git-Tag: 1.31.0-rc.0~21675 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=0cc1ab9f9d8b124538264aff197681f4c28e4d80;p=lhc%2Fweb%2Fwiklou.git * (bug 41966) Follow-up I551a90b0 (c2172d4): fix fatal error in PoolWorkArticleView::doWork() The error is Fatal error: Call to a member function getParserOutput() on a non-object in includes/WikiPage.php on line 3363. The problem is that if the fifth parameter passed to PoolWorkArticleView::__construct() is not given or is null, which is now the case since the change mentioned on the first line of this commit summary, the content is fetched from Page::getContent(). When the Page object is a WikiPage instance there is no problem, but when this is an Article instance, Article::getContent() actually returns the content as *string* and not as object, like it did before the Wikidata branch merge. Worked arround this by passing the WikiPage object to PoolWorkArticleView from Article::view(). Also removed non-existing sixth parameter to PoolWorkArticleView::__construct(). Change-Id: I537862f519542de4f034be29bba4b75898382f59 --- diff --git a/includes/Article.php b/includes/Article.php index 8403bc6c98..169dd03af3 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -704,9 +704,8 @@ class Article extends Page { # Run the parse, protected by a pool counter wfDebug( __METHOD__ . ": doing uncached parse\n" ); - // @todo: shouldn't we be passing $this->getPage() to PoolWorkArticleView instead of plain $this? - $poolArticleView = new PoolWorkArticleView( $this, $parserOptions, - $this->getRevIdFetched(), $useParserCache, $this->getContentObject(), $this->getContext() ); + $poolArticleView = new PoolWorkArticleView( $this->getPage(), $parserOptions, + $this->getRevIdFetched(), $useParserCache, $this->getContentObject() ); if ( !$poolArticleView->execute() ) { $error = $poolArticleView->getError();