Skip to content

fix: read block config from correct path#33

Merged
e0ipso merged 1 commit into
mainfrom
fix/block-config-form-path
May 25, 2026
Merged

fix: read block config from correct path#33
e0ipso merged 1 commit into
mainfrom
fix/block-config-form-path

Conversation

@e0ipso
Copy link
Copy Markdown
Member

@e0ipso e0ipso commented May 25, 2026

Summary

  • validateTargetBlock() and submitTargetBlock() read from ['target_block', 'config'] which returns the entire form wrapper (containing block_config, context_mapping, no_config keys)
  • The actual block plugin configuration lives one level deeper at ['target_block', 'config', 'block_config']
  • The block plugin receives unrecognized wrapper keys via setConfiguration(), so nothing persists — reopening the form shows defaults

Test plan

  • Add a Proxy Block via Layout Builder, select a target block with configuration options (e.g. "Insider Exclusive Stories")
  • Configure the block settings and save
  • Re-open the block configuration and verify settings are preserved
  • Run vendor/bin/phpunit --debug -c web/core/phpunit.xml.dist web/modules/contrib/proxy_block/tests/src/Unit/TargetBlockFormProcessorTest.php — all 19 tests pass

The form nests the target block's config under
target_block.config.block_config, but validate and submit
read from target_block.config — returning the wrapper array
(with block_config, context_mapping, no_config keys) instead
of actual plugin configuration. Nothing persists.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TargetBlockFormProcessor service and its corresponding unit tests to use a more specific form state key, ['target_block', 'config', 'block_config'], instead of the previous ['target_block', 'config']. This change affects both the validation and submission logic for target blocks. I have no feedback to provide.

@e0ipso e0ipso merged commit 92952d7 into main May 25, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.6.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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