From ee7898a1022b101f1d7b93a27c4e05516534571d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 17 Oct 2011 19:16:33 +0000 Subject: [PATCH] * (bug 31692) "summary" parameter now also work when undoing revisions --- RELEASE-NOTES-1.19 | 1 + includes/EditPage.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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'; -- 2.20.1