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
This commit is contained in:
Kevin Israel 2014-09-15 05:44:35 -04:00
parent 03aee0e0cd
commit d6fc82e732

View file

@ -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 ) );