From d6fc82e73235cbbe7ab3aa20103409b2e09094f4 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Mon, 15 Sep 2014 05:44:35 -0400 Subject: [PATCH] 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 --- includes/page/Article.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ) ); -- 2.20.1