Description:
------------
HTML_QuickForm_Controller::exportValues() removes the internal values such as _qf_default; however, HTML_QuickForm_Page::exportValues() does not. Looking at the source, it appears that Page is inheriting exportValues from QuickForm, so overriding it with something similar to Controller's version might be the solution. This is an issue when one can not be sure of the contents of the form (for example, when using DB_Table to abstract field names) and must loop through the array returned by exportValues.
Test script:
---------------
class testPage extends HTML_QuickForm_Page {
function buildForm() {
$this->_formBuilt = TRUE;
$this->addElement('text','tester');
$this->addElement('submit',$this->getButtonName('next'),'Next');
$this->setDefaultAction('next');
}
}
class testAction extends HTML_QuickForm_Action {
function perform(&$page,$action) {
$page->isFormBuilt() or $page->buildForm();
print_r($page->exportValues());
}
}
Expected result:
----------------
Array
(
[tester] =>
)
Actual result:
--------------
Array
(
[tester] =>
[_qf_test_next] => Next
[_qf_default] => test:next
)

Comments

Implemented in CVS. There is now a new parameter for Page::exportValues(), named $filterInternal and defaulting to false (for BC reasons). If you set that to true, the internal values are filtered from the array.