-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed evaluating default value in
hidden
field (thanks @NicoHood)
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f61725c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed, that this fix breaks the evaluation itself. The reason why this happens is, that the current code itself is a bit missleading:
When this line gets executed,
value
is already set tofield.default
. So|default(field.default)
will never happen anyways. The code worked before, asvalue
was evaluated.Now with the new code
value
is taken preferred to the evaluation code(field.value ?? (field.evaluate ? evaluate(field.default) : field.default))
, sovalue
will always befield.default
, always no evaluated.PR #473 fixes that issue and adds a more general evaluation support.
f61725c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as I didn't take the field.html.twig into account.