From: Marius Hoch Date: Mon, 16 Nov 2015 22:13:55 +0000 (+0100) Subject: Don't claim model validation failed if the content couldn't be loaded X-Git-Tag: 1.31.0-rc.0~8982 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=787cd8a78850fe8d075ddb3babb5454758282ccf;p=lhc%2Fweb%2Fwiklou.git Don't claim model validation failed if the content couldn't be loaded Also include the corresponding revision id in the exception message. Bug: T118747 Change-Id: If3e5694f8b471045cf62d672f414446cf5365ed5 --- diff --git a/includes/Revision.php b/includes/Revision.php index a498817c9b..3b98a65aea 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1505,11 +1505,18 @@ class Revision implements IDBAccessObject { } $content = $this->getContent( Revision::RAW ); + $prefixedDBkey = $title->getPrefixedDBkey(); + $revId = $this->mId; - if ( !$content || !$content->isValid() ) { - $t = $title->getPrefixedDBkey(); - - throw new MWException( "Content of $t is not valid! Content model is $model" ); + if ( !$content ) { + throw new MWException( + "Content of revision $revId ($prefixedDBkey) could not be loaded for validation!" + ); + } + if ( !$content->isValid() ) { + throw new MWException( + "Content of revision $revId ($prefixedDBkey) is not valid! Content model is $model" + ); } }