Home » HTML » HTML_QuickForm » Bug #5968
Supposed error in insertElementBefore()
Details
| Submitted | 2005-11-15 13:31 UTC |
|---|---|
| From | themars at users dot sourceforge dot net |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 4.3.9 |
| OS | Linux 2.4.7-10smp |
| Roadmaps | (Not assigned) |
Comments
[2005-11-15 13:31 UTC] themars at users dot sourceforge dot net
Description:
------------
I am using HTML_QuickForm 3.2.5
If you want to add a field with the insertElementBefore method, it will return a Notice and a Warning on line 679 if you have elements defined with an empty name (e.g. static fields) after the referenced element.
Because array elements with an empty keys are discarded (without a notice), these elements are not recorded in the arrays _elementIndex and _duplicateIndex.
You can avoid these errors by changing the code in the section "test script" below into the code in the section "expected result" below (line 678). But still the indexes are not updated. I do not know a simple solution for that; or always specifing a name.
Test script:
---------------
} else {
Expected result:
----------------
} elseif (!empty($currentName)) {