PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm_Controller » Bug #1547

SetDefaults doesn't accept filters

Details

Request #1547SetDefaults doesn't accept filters
Submitted2004-06-02 20:28 UTC
Fromtdr32 at cs dot byu dot edu
Assignedavb
StatusClosed
PackageHTML_QuickForm_Controller
PHP Version4.2.2
OSRedHat 9
Roadmaps(Not assigned)

Comments

[2004-06-02 20:28 UTC] tdr32 at cs dot byu dot edu

Description:
------------
Will trying to port my code from HTML_QuickForm to HTML_QuickForm_Controller, I noticed that my setDefaults filter was not being used. By inspection of the actual code for the Controller.php, the setDefaults doesn't accept a filter variable. I have fixed it in my own version by just adding in code from HTML_QuickForm to give HTML_QuickForm_Controller the ability.

Reproduce code:
---------------
// In Index.php
$form->get_default_values();

// in form class

function get_default_values() {
$controller->setDefaults($this->default_values, array(&$this, 'filter_defaults'));
}

function filter_defaults($value) {
// programming to filter the values sent
return $value;
}

Expected result:
----------------
Well, it should just go use the filter_defaults() function.

Actual result:
--------------
It doesn't use the function