From ea8ac38e45307d667b8243f68772394889d1d8b0 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 25 Jul 2013 17:34:20 +0200 Subject: [PATCH] Show the revision ID on error message when content is missing on difference page Currently if the revision exists but its content is not found, it will make loadText() return false; which in turn will make a call to showMissingRevision() from showDiff(). However since the revision exists; it will not match the condition in showMissingRevision() and thus an error message will appear without any revision ID. Change-Id: Idd8a5f20a3c082a3b02bd77557e0f4dc4c66e876 --- includes/diff/DifferenceEngine.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 3ff5c986cb..97b5b700b2 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -185,10 +185,14 @@ class DifferenceEngine extends ContextSource { $out = $this->getOutput(); $missing = array(); - if ( $this->mOldRev === null ) { + if ( $this->mOldRev === null || + ( $this->mOldRev && $this->mOldContent === null ) + ) { $missing[] = $this->deletedIdMarker( $this->mOldid ); } - if ( $this->mNewRev === null ) { + if ( $this->mNewRev === null || + ( $this->mNewRev && $this->mNewContent === null ) + ) { $missing[] = $this->deletedIdMarker( $this->mNewid ); } -- 2.20.1