From: Alexandre Emsenhuber Date: Mon, 17 Oct 2011 19:16:33 +0000 (+0000) Subject: * (bug 31692) "summary" parameter now also work when undoing revisions X-Git-Tag: 1.31.0-rc.0~27042 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ee7898a1022b101f1d7b93a27c4e05516534571d;p=lhc%2Fweb%2Fwiklou.git * (bug 31692) "summary" parameter now also work when undoing revisions --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index c6f376ed65..50753dce43 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/includes/EditPage.php b/includes/EditPage.php index 7ac9c90d98..1c44c3be41 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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';