Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.3.2

Request #19403 getValue() returns wrong technical field
Submitted: 2012-04-28 16:03 UTC
From: loki Assigned: avb
Status: Closed Package: HTML_QuickForm2 (version 2.0.0beta2)
PHP Version: 5.4.1 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2012-04-28 16:03 UTC] loki (Alexander Levin)
Description: ------------ getValue() returns wrong technical field Test script: --------------- <?php require_once 'HTML/QuickForm2.php'; require_once 'HTML/QuickForm2/Renderer.php'; $form = new HTML_QuickForm2('elements'); $form->addElement('hidden', 'test', null); $form->addElement('submit'); $renderer = HTML_QuickForm2_Renderer::factory('default'); $form->render($renderer); var_dump($form->getValue()); echo $renderer; Expected result: ---------------- array 'test' => string '' (length=0) Actual result: -------------- array '_qf__elements' => string '' (length=0) 'test' => string '' (length=0)

Comments

 [2012-05-02 12:33 UTC] avb (Alexey Borzov)
-Type: Bug +Type: Feature/Change Request
It is a feature request rather than a bug report, we didn't promise to strip these fields. We do similar stuff in Controller::getValue(), though, so will probably add a means to strip these in QuickForm2::getValue(), too.
 [2012-05-15 21:09 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. -- Implemented this as a filter on QuickForm2 object, thus getRawValue() still returns internal fields but getValue() does not.