Closed o1y closed 1 month ago
Yes in v5 the default value you pick in blueprints will be the actual value now.
Ok, thanks! I’ll then migrate my templates.
This somehow causes more problems than it helps :)
Is it really intended behaviour to return a default value for a field which is completely hidden from the publish form?
Is it really intended behaviour to return a default value for a field which is completely hidden from the publish form?
Yes, it's intended, field conditions only apply to publish forms.
If you have conditional logic, you should probably be mirroring that in your templates, like this:
{{ if a_toggle_that_controls_whether_another_is_shown }}
{{ the_other_one }}
{{ /if }}
Instead of just this:
{{ the_other_one }}
Bug description
In V5 Statamic seems to always use the default value of a field, even if the field property is not present in the markdown. In V4 null was returned in this case. I'm not sure if this is an expected behavior, but this could break some templates.
How to reproduce
page_layout
and put{{ page_layout }}
to your Antlers template.default
.page_layout
property is not saved to the markdown.Parsing V5 (new):
{{ page_layout }}
parses to "default".Parsing V4:
{{ page_layout }}
is null.Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response