Overview
#3516602: SDC `enum` props should have human-readable labels: use `meta:enum` added support for meta:enum human-readable labels for enum props in SDCs. But #3515074: Shape matching MUST work with the resolved equivalents of $refs AND must be compatible with core's upcoming $ref resolving in SDCs accidentally relaxed this requirement.
#3586958: Relative image paths are incorrectly allowed as example image prop values in SDCs and code component example values then refactored this code to make the bug more obvious, and this was caught in post-commit review.
Proposed resolution
Enforce that meta:enum must exist for all enum props.
Add explicit test coverage so we do not regress again.
User interface changes
None
Issue fork canvas-3588972
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 #2
penyaskitoI don't really think is needed. The schema will fill these and discard any extra values. See https://git.drupalcode.org/project/drupal/-/merge_requests/12326/diffs
Confirming is good so leaving open.
Comment #3
longwaveWim explicitly asked for this over in #3586958: Relative image paths are incorrectly allowed as example image prop values in SDCs and code component example values. But if that's the case why do the tests fail when we move the check to the correct place? (it was accidentally skipped before)
Comment #4
longwaveBack to Wim to get some consensus here, otherwise we're just going round in circles.
Comment #5
wim leersI see you misinterpreted my #3586958-25: Relative image paths are incorrectly allowed as example image prop values in SDCs and code component example values, @longwave: #3515074: Shape matching MUST work with the resolved equivalents of $refs AND must be compatible with core's upcoming $ref resolving in SDCs indeed relaxed it, but this was intentional.
Sorry for phrasing it confusingly 😬