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

Select Export Values Issue

Details

Submitted2005-09-28 22:36 UTC
Fromchris dot yates1 at btconnect dot com
StatusBogus
PackageHTML_QuickForm
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2005-09-28 22:36 UTC] chris dot yates1 at btconnect dot com

Description:
------------
HTML_QuickForm 3.2.5
QuickForm/select.php $Id: select.php,v 1.29 2005/07/22 17:30:51 avb Exp $

Using QuickForm_Controller and running the regWizard.php example, the ExportValue function for the select element reports an undefined index $i at line 666

The problem is that _$options is an associative array, so to index into with an integer is incorrect.

Test script:
---------------
QuickForm_Controller example regWizard.php

Here's the fix that worked for me at lines 665 and 666 (original code commented out):
//for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
//if ($v == $this->_options[$i]['attr']['value']) {

foreach ($this->_options as $option) {
if ($v == $option['attr']['value']) {

Expected result:
----------------
All submitted values reported.

Actual result:
--------------
Value from select element on second page not included in reported submitted values.