* (bug 31692) "summary" parameter now also work when undoing revisions
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 17 Oct 2011 19:16:33 +0000 (19:16 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 17 Oct 2011 19:16:33 +0000 (19:16 +0000)
RELEASE-NOTES-1.19
includes/EditPage.php

index c6f376e..50753dc 100644 (file)
@@ -109,6 +109,7 @@ production.
   restrictions on some of the database fields.
 * Timezones are now recognised in user preferences when offset is different
   due to DST
+* (bug 31692) "summary" parameter now also work when undoing revisions
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index 7ac9c90..1c44c3b 100644 (file)
@@ -238,7 +238,12 @@ class EditPage {
                                                $firstrev = $oldrev->getNext();
                                                # If we just undid one rev, use an autosummary
                                                if ( $firstrev->mId == $undo ) {
-                                                       $this->summary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() );
+                                                       $undoSummary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() );
+                                                       if ( $this->summary === '' ) {
+                                                               $this->summary = $undoSummary;
+                                                       } else {
+                                                               $this->summary = $undoSummary . wfMsgForContent( 'colon-separator' ) . $this->summary;
+                                                       }
                                                        $this->undidRev = $undo;
                                                }
                                                $this->formtype = 'diff';