Steps to reproduce: create form with
$multiselect = [ 'type' => 'multiselect', 'options' => [ '1' => '1', '2' => '2' ], 'required' => true, 'default' => [ '1', '2' ] ]; $normal = [ 'label' => 'plain' ]; $dropdown = [ 'label' => 'dropdown', 'dropdown' => true, ]; $hidden = [ 'hide-if' => [ '===', 'hider', 'hide' ] ]; $form = HTMLForm::factory( 'ooui', [ 'hider' => [ 'type' => 'select', 'options' => [ 'hide' => 'hide', 'show' => 'show' ], 'default' => 'hide', ], 'plain' => $multiselect + $normal, 'dropdown' => $multiselect + $dropdown, 'plain-hidden' => $multiselect + $normal + $hidden, 'dropdown-hidden' => $multiselect + $dropdown + $hidden, ], RequestContext::getMain() ); $form->setSubmitCallback( function ( $vals ) { var_dump( $vals ); return true; } ); $form->show();
Select "show" option in the dropdown, then submit.
Expected result: all fields will contain ['1', '2'].
Actual result: three of them will work but dropdown-hidden will be empty.
The bug does not occur when the form is submitted with the "hide" option selected (whether initially or by unhiding and re-hiding). Though that's probably because the form framework is ignoring the submitted value in favor of the default one.