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 #645

buttons with names cause notices with ArraySmarty renderer

Details

Submitted2004-01-30 14:40 UTC
Fromjeroen at terena dot nl
Assignedths
StatusNo Feedback
PackageHTML_QuickForm
PHP Version4.3.4
OSDebian Linux
Roadmaps(Not assigned)

Comments

[2004-01-30 14:40 UTC] jeroen at terena dot nl

Description:
------------
I encountered a small problem after adding buttons that don't have names. I get notices when I leave the $name argument null

Setting names for submit and button elements works fine, but I believe it was always possible to leave these NULL, it is poissble with other renderers and also with the stable ArraySmaryt that came with QF 3.2.1

Reproduce code:
---------------
$control[0] =& HTML_QuickForm::createElement('submit', null, 'Submit');
$control[1] =& HTML_QuickForm::createElement('button', null, 'Cancel',array("onClick"=>"location.href='".$_SERVER['PHP_SELF']."'"));
$form->addGroup($control,'control',null,' ');

It throws me some notices:

*When I use names instead of NULL for the button and submit elements it does work.

HTH

jeroen

Expected result:
----------------
No notices

Actual result:
--------------
*Notice*: Undefined index: keys in */usr/local/share/php/pear/HTML/QuickForm/Renderer/ArraySmarty.php* on line *195*

*Notice*: Undefined index: keys in */usr/local/share/php/pear/HTML/QuickForm/Renderer/ArraySmarty.php* on line *222

[2004-02-04 16:42 UTC] ths at php dot net

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

Unnamed group items (unless radios) are not rendered as subarrays.