Home » Database » DB_DataObject_FormBuilder » Bug #1981
not adding rules in postGenerateForm
Details
| Submitted | 2004-07-26 14:53 UTC |
|---|---|
| From | marcelo at beteltecnologia dot com dot br |
| Assigned | mw21st |
| Status | Closed |
| Package | DB_DataObject_FormBuilder |
| PHP Version | 4.3.8 |
| OS | Windows XP |
| Roadmaps | (Not assigned) |
Comments
[2004-07-26 14:53 UTC] marcelo at beteltecnologia dot com dot br
Description:
------------
When I define rules is postGenerateForm, they are not being enforced when the form is constructed.
The postGenerateForm method is being triggered but is like the form variable, passed to the method, is not being passed by reference, so the changes are being lost and the rules have no effect.
I saw Bug #917 but it didn't help. I didn't alter FormBuilder.php.
Reproduce code:
---------------
function postGenerateForm(&$form) {
$form->addRule('descricao', 'Por favor entre com a descrição','required',null,'client');
$form->addRule('CodCatMateriaPrima', 'A categoria é requerida','required',null,'client');
$form->applyFilter('__ALL__', 'trim');
}
Expected result:
----------------
the form should enforce the rules added.
Actual result:
--------------
No rules are being added to the form.
[2004-07-26 20:10 UTC] marcelo at beteltecnologia dot com dot br
ok my fault, I retrieved the original file and you are using a call that is deprecated...
$this->_do->postGenerateForm(&$obj);
Is there a way to do this without using "Call-time pass-by-reference" and avoid the warning? I don´t have access to php.ini at my provider. Thanks in advance.
[2004-07-26 21:31 UTC] marcelo at beteltecnologia dot com dot br
I used it without ampersand (&) in version 4.3.8. It didn't work... Maybe this is a overlooked PHP bug.