Overview
#3582478: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI tightens the config schema for config-defined component trees, to pave the path for translatability.
In doing so, the config schema for block component instances automatically is transparently reused: no more type: ignore, but instead type: block.settings.<block plugin ID>
This surfaced a long-hidden bug (AFAICT introduced in #3500997: Move SDC-specific validation in ValidComponentTreeConstraintValidator and ComponentTreeMeetsRequirementsConstraintValidator into the SDC source plugin) that causes root-level violations (at the root of block plugin settings) to generate incorrect property paths.
Proposed resolution
Fix.
User interface changes
None.
Issue fork canvas-3584143
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
wim leersReady for final review — see the two ℹ️ threads on the MR for guidance.
Comment #4
penyaskito🚢 it!
Comment #5
wim leersNeeds follow-up for https://git.drupalcode.org/project/canvas/-/merge_requests/899#note_745820 — that's out-of-scope technical debt that I'll try to address using a new PHPCS or PHPStan rule 🤞
Tagging to ensure I don't forget.
Comment #7
wim leersComment #9
mayur-sose commentedVerified the API validation path mapping for block components:
2. Include a block component but omit a required root-level setting.
3. Inspect the 422 JSON response.
elements.[uuid].inputs.[setting_name]) without malformed segments or double dots.2. Provide an invalid value for a deep setting (e.g.,
config.advanced.toggle).3. Inspect the 422 response.
2. Intentionally violate a validation rule on the SDC's inputs.
3. Inspect the 422 response.
ConstraintPropertyPathTranslatorTrait.2. Send the POST/PATCH request to save the Canvas Page.