Skip to content

Fix: block-renderer 400 for third-party blocks (frbl* attrs not registered server-side) - #274

Open
davidperezgar wants to merge 2 commits into
trunkfrom
fix/animations-block-renderer-schema-mismatch
Open

Fix: block-renderer 400 for third-party blocks (frbl* attrs not registered server-side)#274
davidperezgar wants to merge 2 commits into
trunkfrom
fix/animations-block-renderer-schema-mismatch

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The blocks.registerBlockType JS filter in Animations.php injects frblAnimation and 9 related attributes into every block's editor settings (client-side only), but no PHP counterpart registered them in each block's REST schema.
  • Any third-party block whose block.json doesn't already declare these attributes gets rejected by wp/v2/block-renderer with rest_additional_properties_forbidden, which breaks ServerSideRender in the editor for that block (shows "Error al cargar el bloque").
  • Found via a real case: the nudge/reviews dynamic block from a separate plugin failed to render in the editor with this exact error.
  • Adds a register_block_type_args filter that mirrors the same attributes (and the same gravityforms/ exclusion) server-side, so the REST block-renderer schema matches what the client already sends. Same pattern already used elsewhere in this plugin (TextAnimation.php, StickyColumn.php, Headline.php, etc.) for the same reason.

Test plan

  • Reproduced the 400 on wp/v2/block-renderer/nudge/reviews before the fix (rest_invalid_param / frblAnimation no es una propiedad válida del objeto)
  • Confirmed 200 after the fix, block renders correctly in the editor
  • Spot-check a couple of core/native blocks in the editor to confirm animation panel still works as before

🤖 Generated with Claude Code

Open WordPress Playground Preview

…schema

The blocks.registerBlockType JS filter injects frblAnimation and related
attributes into every block's editor settings, but no PHP counterpart
declared them in the block's REST schema. Any third-party block whose
block.json doesn't already list these attributes gets rejected by
wp/v2/block-renderer with rest_additional_properties_forbidden, breaking
ServerSideRender in the editor for that block.

Add a register_block_type_args filter that mirrors the same attributes
and the same gravityforms/ exclusion server-side, so the schema used by
the REST block-renderer matches what the client already sends.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T07:21:03.668255Z a9ecdf6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70497ba186

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread includes/Frontend/Animations.php
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