[#3577380] Fix beforeSubmit form value lookup to use correct field name

Summary

Fixes a bug in the JSON Editor beforeSubmit handler where the form value lookup used the wrong field name (settings[instance_config]) instead of the name the block form actually produces (settings[configuration]). This caused the beforeSubmit callback to never find a match, meaning the editor's latest value was not written back to the hidden field before form submission on full-page block config.

Also adds clarifying comments to PatternUpdateTest explaining that those tests intentionally use the full-page block config URL to exercise PHP-only behavior without JavaScript — this was previously ambiguous given the off-canvas work in #3576066.

Changes

JSON Editor JS (js/patternkit.jsoneditor.js)

  • In beforeSubmit: change form value lookup from settings[instance_config] to settings[configuration] — the name the PatternkitBlock form produces for the JSON Editor element

Functional tests (tests/src/Functional/PatternUpdateTest.php)

  • Add one inline comment per test method clarifying that drupalGet of the full-page block config URL is intentional (tests PHP-only behavior, not the off-canvas JS flow)

Testing

  1. Open a node with a Patternkit block via the full-page block config URL (/layout_builder/update/block/…)
  2. Edit a value in the JSON Editor without clicking out of the field (no blur)
  3. Click Update — the submitted config should reflect the edited value
  4. Confirm PatternUpdateTest passes: ddev exec vendor/bin/phpunit tests/src/Functional/PatternUpdateTest.php

Closes #3577380.

Merge request reports

Loading