Don't show unsaved revision in DifferenceEngine::renderNewRevision.
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 10 Sep 2018 19:02:26 +0000 (21:02 +0200)
committerDaniel Kinzler <daniel.kinzler@wikimedia.de>
Fri, 21 Sep 2018 13:38:56 +0000 (13:38 +0000)
There was a conditional that was documented to make the method bail out
if the current revision was unsaved, but it was missing the actual return
statement.

Note that preview code in EditPage does not use
DifferenceEngine::renderNewRevision.

Change-Id: I86a25e9464435ac17c72f78f7ce1f354adf3d055

includes/diff/DifferenceEngine.php

index 387e9e3..9602bd2 100644 (file)
@@ -848,6 +848,7 @@ class DifferenceEngine extends ContextSource {
                                // New revision is unsaved; bail out.
                                // TODO in theory rendering the new revision is a meaningful thing to do
                                // even if it's unsaved, but a lot of untangling is required to do it safely.
+                               return;
                        }
 
                        $out->setRevisionId( $this->mNewid );