This bug relates to code in includes/htmlform.
When the user submits an HTMLForm, its fields (dropdowns, individual checkboxes, radio buttons, etc.) retain their values when the form redisplays. This feature seems broken for HTMLMultiSelectField fields, however, as of MediaWiki 1.28, when the form is submitted by GET (i.e., $form->setMethod('get')). These fields did retain their value in MediaWiki 1.27, so this behavior appears to be a bug.
Here is sample code that demonstrates the problem. The following special page has a form with two fields: an individual checkbox, and a pair of checkboxes as an HTMLMultiSelectField. On the page, check all three checkboxes and submit the form. The individual checkbox retains its checked state, but the multiselect checkboxes do not. However, if you change the submit method to POST, all three checkboxes retain their values.
Alternatively, if my code has a bug, please educate me - thanks!
<?php class SpecialOrgStructure extends SpecialPage { public function __construct() { parent::__construct('OrgStructure'); } public function execute($par) { $this->setHeaders(); $form = new MyForm(); $form->setTitle($this->getTitle()); $form->setMethod('get'); $form->loadData(); $form->displayForm(''); } } class MyForm extends HTMLForm { public function __construct() { parent::__construct($this->render(), 'orgstructure'); } public function render() { $formElements = array( 'onecheckbox' => array( 'name' => 'onecheckbox', 'type' => 'check', 'label' => 'Single checkbox', ), 'twocheckboxes' => array( 'name' => 'twocheckboxes', 'type' => 'multiselect', 'label' => 'Multiselect:', 'options' => array('a'=>'b', 'c'=>'d'), ), ); return $formElements; } }