| Index: trunk/phase3/includes/specials/SpecialEditWatchlist.php |
| — | — | @@ -388,7 +388,7 @@ |
| 389 | 389 | : htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) ); |
| 390 | 390 | |
| 391 | 391 | $fields['TitlesNs'.$namespace] = array( |
| 392 | | - 'type' => 'multiselect', |
| | 392 | + 'class' => 'EditWatchlistCheckboxSeriesField', |
| 393 | 393 | 'options' => array(), |
| 394 | 394 | 'section' => "ns$namespace", |
| 395 | 395 | ); |
| — | — | @@ -540,3 +540,21 @@ |
| 541 | 541 | : htmlspecialchars( $this->getContext()->getLang()->getFormattedNsText( $namespace ) ); |
| 542 | 542 | } |
| 543 | 543 | } |
| | 544 | + |
| | 545 | +class EditWatchlistCheckboxSeriesField extends HTMLMultiSelectField { |
| | 546 | + /** |
| | 547 | + * HTMLMultiSelectField throws validation errors if we get input data |
| | 548 | + * that doesn't match the data set in the form setup. This causes |
| | 549 | + * problems if something gets removed from the watchlist while the |
| | 550 | + * form is open (bug 32126), but we know that invalid items will |
| | 551 | + * be harmless so we can override it here. |
| | 552 | + * |
| | 553 | + * @param $value String the value the field was submitted with |
| | 554 | + * @param $alldata Array the data collected from the form |
| | 555 | + * @return Mixed Bool true on success, or String error to display. |
| | 556 | + */ |
| | 557 | + function validate( $value, $alldata ) { |
| | 558 | + // Need to call into grandparent to be a good citizen. :) |
| | 559 | + return HTMLFormField::validate( $value, $alldata ); |
| | 560 | + } |
| | 561 | +} |
| \ No newline at end of file |