Problem/Motivation
Eight components restrict the icon pack this way:
icon:
$ref: ui-patterns://icon
properties:
pack_id:
enum:
- dsfr
An enum alone is valid JSON Schema, but Drupal Canvas may read the type of every nested prop schema. With the theme and Canvas installed, drush en canvas, component generation and every recipe apply would fail with TypeError: strtolower(): Argument #1 ($string) must be of type string, null given in PropShape.php.
On sites with justinrainbow/json-schema 6.9 or later, ui_patterns would also stop recognizing these props as icons (widget and pack restriction lost). That one may be a ui_patterns bug, fixed there, but the change below makes the theme work with the current ui_patterns releases too.
Steps to reproduce
Install ui_patterns, ui_suite_dsfr, then canvas. Apply any recipe.
Proposed resolution
Declare pack_id as the icon prop type does, and keep the restriction:
pack_id:
$ref: ui-patterns://identifier
enum:
- dsfr
Components: button, callout, card (two props), download_block, link, modal, tab, tag.
Stored values do not change.
Issue fork ui_suite_dsfr-3624904
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
just_like_good_vibesComment #5
just_like_good_vibes