jenkins-bot has submitted this change and it was merged.
Change subject: Article: Show error message when Revision::getContent() fails
......................................................................
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
---
M includes/page/Article.php
1 file changed, 9 insertions(+), 1 deletion(-)
Approvals:
Daniel Kinzler: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 9ce3854..0fc251e 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -410,10 +410,18 @@
// @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 ) );
--
To view, visit https://gerrit.wikimedia.org/r/185098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id9eed4bd3d8241d445b15948f1544040394012c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits