Home » HTML » HTML_QuickForm_advmultiselect » Bug #5275
When unselecting all it returns default value
Details
| Submitted | 2005-09-02 07:08 UTC |
|---|---|
| From | martin at bymartin dot com |
| Assigned | farell |
| Status | Closed |
| Package | HTML_QuickForm_advmultiselect |
| PHP Version | 5.0.4 |
| OS | freeBSD |
| 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)
}