SDC prop of `type: string` with empty string listed in its `enum` results in broken input UX

Created on 29 January 2025, 6 days ago

Overview

Discovered in Create a ComponentSource plugin for JS components Active .

Try using the sdc_test:my-cta SDC.

XB happily accepts it. But then creates an input UX that crashes, due to one of the allowed values for the target prop being ''.

Proposed resolution

Modify \Drupal\experience_builder\JsonSchemaInterpreter\SdcPropJsonSchemaType::computeStorablePropShape(): detect if '' is one of the values in the enum and if so, return NULL (to indicate this is not supported).

User interface changes

None.

🐛 Bug report
Status

Active

Version

0.0

Component

Shape matching

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024