-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Clear form does not work #15956
Comments
Ater few more tests if you change order and add field first and then you try to clear it then it couse Segmentation fault (11) - only in 5.x version. 3.x and 4.x order is not a problem $textField = new Text('textField', [
'placeholder' => 'Text field to clear after submit',
]);
$this->add($textField);
$textField->clear(); |
I think I'm facing the same problem. Win10, PHP 8.1.7, Phalcon v5.0.0RC2. <?php
class TestForm extends \Phalcon\Forms\Form {
public function initialize() {
$this->add(new \Phalcon\Forms\Element\Text('test'));
// freezes with clear
$this->clear();
}
}
new TestForm; |
When i use clear() on element, it goes to infinite loop! Details: |
Resolved in #16191 Thank you @bakos @Deathamns @alimo2 |
Describe the bug
Clear is not working on form elements values. (https://docs.phalcon.io/5.0/pl-pl/api/phalcon_forms : Clears element to its default value)
To Reproduce
Steps to reproduce the behavior:
This should clear element to its default value
Form:
Action in contoller
Template view
Expected behavior
Fields values should be cleared. It works in phalcon 3.x and 4.x.
Details
Additional context
I found commit related to the problem:
9992bb2
The text was updated successfully, but these errors were encountered: