Home » HTML » HTML_QuickForm_Controller » Bug #1547
SetDefaults doesn't accept filters
Details
| Request #1547 | SetDefaults doesn't accept filters |
|---|---|
| Submitted | 2004-06-02 20:28 UTC |
| From | tdr32 at cs dot byu dot edu |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm_Controller |
| PHP Version | 4.2.2 |
| OS | RedHat 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