ZF-7048: Zend_View_Helper_FormRadio creates invalid labels and id's
Description
There's a problem when passing an array to Zend_View_Helper_FormRadio that contains positive and negative values,
This array for example
$opties = array('1' => 'Some option',
'-1' => 'Another option');
Will generate 2 radio buttons with the id "myname-1". Duplicate id's are not allowed and it also disables you from choosing the desired option. When you choose 'Another option' by clicking the label the radio button for 'Some option' will be selected.
Comments
Posted by Thomas Weidner (thomas) on 2009-07-09T23:42:42.000+0000
Component assigned
Posted by C Snover (snover) on 2009-08-03T20:25:28.000+0000
Although we can't quite match on the full list of valid characters since PHP's regular expressions can't match Unicode character ranges, creating and using this filter instead of the Alnum filter should work for all cases when only 7-bit characters are used in IDs (which should be pretty much always):
Patch against 1.8.4PL1:
There are probably other cases where this new filter should be used as well but I am not going to go looking for them right now. :)
Posted by Dmitry Plenkin (sukebe) on 2011-07-08T07:16:17.000+0000
Fixed in 1.11.8 Hell yeah!