nette / forms

📝 Generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.
https://doc.nette.org/forms
Other
497 stars 147 forks source link

setValue() as well as setDefaultValue() don't set the value and the field shows error states instead #314

Closed thekayshawn closed 10 months ago

thekayshawn commented 10 months ago

Version: 3.1

Bug Description

While using Nette Forms within the framework in a presenter, setValue() nor setDefaultValue() set the value of a field and instead render the errors for that field due to the required condition.

Steps To Reproduce

Simply create an app and create a form and try setting the default value and rendering the field using either or {input name}, neither does the value auto-render nor can it be seen with getValue().

Expected Behavior

setValue() should set a value and setDefaultValue() should set a default value.

thekayshawn commented 10 months ago

Man, don't you hate it when things auto-resolve without you doing anything? After wasting 2 days trying to find a solution, the base setValue and setDefaultValue functions now work out of the box, not saying I hate SWE but I kinda do.

dakorpar commented 10 months ago

What we hadas a problem was some super wierd bug, I'd say maybe even a PHP related (8.2.11) that could be same that you hitted maybe... Looks like developers that uses windows are affected when running locally. When rendering form

is missing just before closing form tag (). On version 3.1.11 all works fine, but on 3.1.12 form is never submitted. onBeforeRender on form never even gets submitted.

Simple login form and only when rendered with

works fine when rendered as {control form} Another interesting thing is that after you login once with {control form} ... manual rendering works fine, completelly insane... Two developers in my team were affected...

@dg did you hear something about that?