Skip to content

Query Filter: Guard against missing key attribute - #732

Merged
dd32 merged 1 commit into
trunkfrom
fix/claude/query-filter-undefined-key
Mar 9, 2026
Merged

dd32 merged 1 commit into
trunkfrom
fix/claude/query-filter-undefined-key

Conversation

@dd32

@dd32 dd32 commented Mar 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an early return in the query-filter block render when the key attribute is not set, preventing an Undefined array key "key" PHP warning.
  • The guard is placed before the docblock and apply_filters call, matching the existing early-return pattern used for missing options.

Test plan

  • Verify that query-filter blocks with a key attribute still render correctly.
  • Verify that query-filter blocks without a key attribute render nothing and produce no PHP warnings.

🤖 Generated with Claude Code

Adds an early return when the block key attribute is not set,
preventing an "Undefined array key" PHP warning on render.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dd32

dd32 commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

This happens due to people adding it via the site editor without the key, mostly in test templates, it's easier to just not render when used incorrectly.

@dd32
dd32 merged commit 42777d5 into trunk Mar 9, 2026
2 checks passed
@dd32
dd32 deleted the fix/claude/query-filter-undefined-key branch March 9, 2026 04:05
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.

1 participant