Replies: 1 comment 5 replies
-
If a field doesn’t exist in a field layout, it doesn’t get a property on the element either, so you’d actually get an error if you tried to access the lightswitch value when Dev Mode is enabled (and Twig is set to strict mode); or it would be |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recognizing that it is probably too late to change this behavior, the current setup seems really weird and unintuitive.
Logically if a light switch filed doesn't exist on an entry type the position should be assumed
false
not whatever the default for the filed happens to be for the purpose of a database query.Example, we have an entry type that has a special mode that when true should exclude it from a feed. None of the other entry types have this mode as it should always be false for them. But new special entries should start out in the special mode, so the filed default should be true. But it cannot be true by default, which is not ideal for users, and be able to have this work. It seems logical to assume a field that doesn't exist would return
null
for an entry type .Either that, or add a configurable option for how the filed should be treated when queried on entry types that don't have it. But the current behavior seems a lot more like a bug than anything else.Beta Was this translation helpful? Give feedback.
All reactions