From d8f54674431907a301a93bbe5cc105da670f6bb9 Mon Sep 17 00:00:00 2001 From: cenarium Date: Sat, 13 Jun 2015 19:02:12 +0200 Subject: [PATCH] Pass wpExistingTags in the request when multiple revisions are selected Not doing so breaks the option to remove all tags. Bug: T102186 Change-Id: I961b29d78ec7dd7a48f3bb4633f9c057125cce5b --- includes/specials/SpecialEditTags.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialEditTags.php b/includes/specials/SpecialEditTags.php index d2b2e70846..6545541a09 100644 --- a/includes/specials/SpecialEditTags.php +++ b/includes/specials/SpecialEditTags.php @@ -275,6 +275,7 @@ class SpecialEditTags extends UnlistedSpecialPage { protected function buildCheckBoxes() { // If there is just one item, provide the user with a multi-select field $list = $this->getList(); + $tags = array(); if ( $list->length() == 1 ) { $list->reset(); $tags = $list->current()->getTags(); @@ -295,14 +296,9 @@ class SpecialEditTags extends UnlistedSpecialPage { $html .= ''; $tagSelect = $this->getTagSelect( $tags, $this->msg( 'tags-edit-new-tags' )->plain() ); $html .= '' . $tagSelect[0] . '' . $tagSelect[1]; - // also output the tags currently applied as a hidden form field, so we - // know what to remove from the revision/log entry when the form is submitted - $html .= Html::hidden( 'wpExistingTags', implode( ',', $tags ) ); - $html .= ''; } else { // Otherwise, use a multi-select field for adding tags, and a list of // checkboxes for removing them - $tags = array(); // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed for ( $list->reset(); $list->current(); $list->next() ) { @@ -328,9 +324,13 @@ class SpecialEditTags extends UnlistedSpecialPage { 'class' => 'mw-edittags-remove-checkbox', ) ); } - $html .= ''; } + // also output the tags currently applied as a hidden form field, so we + // know what to remove from the revision/log entry when the form is submitted + $html .= Html::hidden( 'wpExistingTags', implode( ',', $tags ) ); + $html .= ''; + return $html; } -- 2.20.1