From 787cd8a78850fe8d075ddb3babb5454758282ccf Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Mon, 16 Nov 2015 23:13:55 +0100 Subject: [PATCH] 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 --- includes/Revision.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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" + ); } } -- 2.20.1