Skip to content

Guard missing content in PrettyBlocks extra states#951

Merged
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-undefined-array-key-warning-jszwhd
Feb 5, 2026
Merged

Guard missing content in PrettyBlocks extra states#951
CySSoO merged 1 commit intomasterfrom
cyssoo/fix-undefined-array-key-warning-jszwhd

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Feb 5, 2026

Motivation

  • Prevent PHP notices caused by rendering extra PrettyBlocks states when content is missing.
  • Avoid accidental overwriting of the main $state variable when iterating extra states.

Description

  • Rename the extra-states loop variable to $extra_state to keep the main $state intact.
  • Add a guard isset($extra_state.content) before rendering to skip missing content.
  • Change applied in views/templates/hook/prettyblocks/prettyblock_everblock.tpl.

Testing

  • No automated tests were run.

Codex Task

@CySSoO CySSoO merged commit e0bf009 into master Feb 5, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant