PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5968

Supposed error in insertElementBefore()

Details

Submitted2005-11-15 13:31 UTC
Fromthemars at users dot sourceforge dot net
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.9
OSLinux 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)) {