[#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 fromsettings[instance_config]tosettings[configuration]— the name thePatternkitBlockform produces for the JSON Editor element
Functional tests (tests/src/Functional/PatternUpdateTest.php)
- Add one inline comment per test method clarifying that
drupalGetof the full-page block config URL is intentional (tests PHP-only behavior, not the off-canvas JS flow)
Testing
- Open a node with a Patternkit block via the full-page block config URL (
/layout_builder/update/block/…) - Edit a value in the JSON Editor without clicking out of the field (no blur)
- Click Update — the submitted config should reflect the edited value
- Confirm
PatternUpdateTestpasses:ddev exec vendor/bin/phpunit tests/src/Functional/PatternUpdateTest.php
Closes #3577380.