Merge "HTMLMultiSelectField: Add forced-on options to the output of filter"
This commit is contained in:
commit
499f36d60f
1 changed files with 2 additions and 1 deletions
|
|
@ -292,10 +292,11 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable
|
|||
public function filterDataForSubmit( $data ) {
|
||||
$data = HTMLFormField::forceToStringRecursive( $data );
|
||||
$options = HTMLFormField::flattenOptions( $this->getOptions() );
|
||||
$forcedOn = array_intersect( $this->mParams['disabled-options'], $this->getDefault() );
|
||||
|
||||
$res = [];
|
||||
foreach ( $options as $opt ) {
|
||||
$res["$opt"] = in_array( $opt, $data, true );
|
||||
$res["$opt"] = in_array( $opt, $forcedOn, true ) || in_array( $opt, $data, true );
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
|
|
|||
Loading…
Reference in a new issue