ZF-8452: Zend Form Element Select Implied Multiple Select
When using Zend_Form_Element_Select in conjunction of setIsArray it is implied that you want a multiple select, when you may not. Now this is definitely a feature for those who want it, but for those who want multiple selects it's a problem.
For example if I use the following code:
$field = new Zend_Form_Element_Select('field'); $field->setIsArray(true) ->setMultiOptions(array( 'a' => 'A', 'b' => 'B', 'c' => 'C', ));
I get the following output:
When I want the desired output:
I have looked into work arounds for this problem, but I don't feel they're appropriate for such a simple problem which can easily be corrected by removal of three lines.
Now I propose either we remove the offending code which is on 77 to 79 of Zend_View_Helper_FormSelect which will simply mean people wanting multiple select will be required to add setAttrib('multiple', 'multiple') but will break backwards compatability I believe, or add an option to disable that code.