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.

Command icon 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

just_like_good_vibes created an issue. See original summary.

just_like_good_vibes’s picture

Version: 1.0.x-dev » 1.15.2

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.