Show the revision ID on error message when content is missing on difference page
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Thu, 25 Jul 2013 15:34:20 +0000 (17:34 +0200)
committerIAlex <codereview@emsenhuber.ch>
Tue, 17 Sep 2013 06:52:14 +0000 (06:52 +0000)
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

index 3ff5c98..97b5b70 100644 (file)
@@ -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 );
                }