Skip to content

[6.x] Respect field defaults when resolving queryable values - #15899

Closed
edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:claude/busy-euler-lepuof
Closed

edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:claude/busy-euler-lepuof

Conversation

@edalzell

@edalzell edalzell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Entries that have never saved a field with a blueprint default were indexed without it, so query conditions like my_toggle:is="true" skipped them even though templates showed the default.

Add Field::toQueryableValue(), which falls back to the field's default when the value is null, and use it wherever queryable values are resolved. Computed defaults are skipped since they resolve at runtime.

Entries (and terms, assets, users, globals, forms and submissions) that
have never saved a field with a blueprint default were indexed without
it, so query conditions like my_toggle:is="true" skipped them even
though templates showed the default.

Add Field::toQueryableValue(), which falls back to the field's default
when the value is null, and use it wherever queryable values are
resolved. Computed defaults are skipped since they resolve at runtime.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PLV53GTXNZejm3MT73vJLv
@edalzell edalzell closed this Nov 14, 2026
@edalzell
edalzell deleted the claude/busy-euler-lepuof branch November 14, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants