From: Kevin Israel Date: Mon, 15 Sep 2014 09:44:35 +0000 (-0400) Subject: Article: Show error message when Revision::getContent() fails X-Git-Tag: 1.31.0-rc.0~12670^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=d6fc82e73235cbbe7ab3aa20103409b2e09094f4;p=lhc%2Fweb%2Fwiklou.git Article: Show error message when Revision::getContent() fails It already checks for other errors though not this specific one (e.g. missing text row or external storage row). Change-Id: Id9eed4bd3d8241d445b15948f1544040394012c3 --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 9ce3854e99..0fc251e91f 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -410,10 +410,18 @@ class Article implements Page { // @todo FIXME: Horrible, horrible! This content-loading interface just plain sucks. // We should instead work with the Revision object when we need it... // Loads if user is allowed - $this->mContentObject = $this->mRevision->getContent( + $content = $this->mRevision->getContent( Revision::FOR_THIS_USER, $this->getContext()->getUser() ); + + if ( !$content ) { + wfDebug( __METHOD__ . " failed to retrieve content of revision " . + $this->mRevision->getId() . "\n" ); + return false; + } + + $this->mContentObject = $content; $this->mRevIdFetched = $this->mRevision->getId(); Hooks::run( 'ArticleAfterFetchContentObject', array( &$this, &$this->mContentObject ) );