PEAR is archived and read-only

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

Home » HTML » HTML_QuickForm_advmultiselect » Bug #5275

When unselecting all it returns default value

Details

Submitted2005-09-02 07:08 UTC
Frommartin at bymartin dot com
Assignedfarell
StatusClosed
PackageHTML_QuickForm_advmultiselect
PHP Version5.0.4
OSfreeBSD
Roadmaps(Not assigned)

Comments

[2005-09-02 07:08 UTC] martin at bymartin dot com

Description:
------------
When unselecting all items. exportValues() and exportValue() returns default values insted of an empty array or null.

Test script:
---------------
<?php

require_once('HTML/QuickForm.php');
require_once 'HTML/QuickForm/advmultiselect.php';

$form = new HTML_QuickForm('test');

$form->setDefaults(array('advM'=>array(0)));

$form->addElement('advmultiselect', 'advM', 'advM', array('test1','test2'));
$form->addElement('submit');

var_dump($form->exportValues());

var_dump($form->exportValue('advM'));

$form->display();

Expected result:
----------------
array(1) {
["advM"]=>
array(0) {
}
}
array(0) {
}

Actual result:
--------------
array(1) {
["advM"]=>
array(1) {
[0]=>
int(0)
}
}
array(1) {
[0]=>
int(0)
}