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:
parent
03aee0e0cd
commit
d6fc82e732
1 changed files with 9 additions and 1 deletions
|
|
@ -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 ) );
|
||||
|
|
|
|||
Loading…
Reference in a new issue