Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #8497 3.2.6 hierselect can't handle numeric options (chokes on indexOf)
Submitted: 2006-08-18 05:01 UTC
From: gmalazdrewicz at gmail dot com Assigned: avb
Status: Closed Package: HTML_QuickForm (version 3.2.6)
PHP Version: 4.3.9 OS: Linux 2.4.21 (RHEL3)
Roadmaps: (Not assigned)    

 [2006-08-18 05:01 UTC] gmalazdrewicz at gmail dot com (Gerardo Malazdrewicz)
Description: ------------ Use of hierselect with numeric options causes it to cease functioning when you choose another option. Firefox JavaScript console reports "indexOf is not a function" Fix: Convert the numeric options to strings before processing. Test script: --------------- Patch: ------------------------------------------------------------- for (i in optionList) { + var option = String(optionList[i]); - var optionText = (-1 == optionList[i].indexOf('&'))? optionList[i]: _hs_unescapeEntities(optionList[i]); + var optionText = (-1 == option.indexOf('&'))? option: _hs_unescapeEntities(option); ctl.options[j++] = new Option(optionText, i, false, false); } -------------------------------------------------------------


 [2006-10-06 15:41 UTC] avb (Alexey Borzov)
Yep, reproduced this.
 [2006-10-07 15:08 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.