Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
EditWatchlistCheckboxSeriesField
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 validate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * @license GPL-2.0-or-later
4 * @file
5 */
6
7namespace MediaWiki\Specials\FormFields;
8
9use MediaWiki\HTMLForm\Field\HTMLMultiSelectField;
10use MediaWiki\HTMLForm\HTMLFormField;
11
12class EditWatchlistCheckboxSeriesField extends HTMLMultiSelectField {
13    /**
14     * HTMLMultiSelectField throws validation errors if we get input data
15     * that doesn't match the data set in the form setup. This causes
16     * problems if something gets removed from the watchlist while the
17     * form is open (T34126), but we know that invalid items will
18     * be harmless so we can override it here.
19     *
20     * @param string $value The value the field was submitted with
21     * @param array $alldata The data collected from the form
22     * @return bool|string Bool true on success, or String error to display.
23     */
24    public function validate( $value, $alldata ) {
25        // Need to call into grandparent to be a good citizen. :)
26        return HTMLFormField::validate( $value, $alldata );
27    }
28}
29
30/** @deprecated class alias since 1.46 */
31class_alias( EditWatchlistCheckboxSeriesField::class, 'EditWatchlistCheckboxSeriesField' );