Fix undo edit summary when the user who made the old revision is hidden
Bug: 48571 Change-Id: I01b034b25032dbbfb67c7f578b501bda746d5335
This commit is contained in:
parent
266e46a5ca
commit
3d104f3fd0
4 changed files with 17 additions and 1 deletions
|
|
@ -935,7 +935,19 @@ class EditPage {
|
|||
# If we just undid one rev, use an autosummary
|
||||
$firstrev = $oldrev->getNext();
|
||||
if ( $firstrev && $firstrev->getId() == $undo ) {
|
||||
$undoSummary = wfMessage( 'undo-summary', $undo, $undorev->getUserText() )->inContentLanguage()->text();
|
||||
$userText = $undorev->getUserText();
|
||||
if ( $userText === '' ) {
|
||||
$undoSummary = wfMessage(
|
||||
'undo-summary-username-hidden',
|
||||
$undo
|
||||
)->inContentLanguage()->text();
|
||||
} else {
|
||||
$undoSummary = wfMessage(
|
||||
'undo-summary',
|
||||
$undo,
|
||||
$userText
|
||||
)->inContentLanguage()->text();
|
||||
}
|
||||
if ( $this->summary === '' ) {
|
||||
$this->summary = $undoSummary;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1577,6 +1577,7 @@ Please check the comparison below to verify that this is what you want to do, an
|
|||
'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.',
|
||||
'undo-norev' => 'The edit could not be undone because it does not exist or was deleted.',
|
||||
'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]])',
|
||||
'undo-summary-username-hidden' => 'Undo revision $1 by a hidden user',
|
||||
|
||||
# Account creation failure
|
||||
'cantcreateaccounttitle' => 'Cannot create account',
|
||||
|
|
|
|||
|
|
@ -1829,6 +1829,8 @@ See also:
|
|||
|
||||
{{Identical|Undo}}',
|
||||
'undo-summary' => 'Edit summary for an undo action.{{Identical|Undo}}',
|
||||
'undo-summary-username-hidden' => 'Edit summary for an undo action where the username of the old revision is hidden.
|
||||
$1 is the revision ID being undone',
|
||||
|
||||
# Account creation failure
|
||||
'cantcreateaccounttitle' => 'Used as title of the error message {{msg-mw|Cantcreateaccount-text}}.',
|
||||
|
|
|
|||
|
|
@ -766,6 +766,7 @@ $wgMessageStructure = array(
|
|||
'undo-failure',
|
||||
'undo-norev',
|
||||
'undo-summary',
|
||||
'undo-summary-username-hidden',
|
||||
),
|
||||
'cantcreateaccount' => array(
|
||||
'cantcreateaccounttitle',
|
||||
|
|
|
|||
Loading…
Reference in a new issue