ValueError: "Drupal\Core\Template\Attribute" is not a valid backing value for enum

Created on 17 March 2025, 4 months ago

Testing install of 0.2.0Alpha4 on a D11 installed initially with Drupal CMS

Getting fatal error on install

ValueError: "Drupal\Core\Template\Attribute" is not a valid backing value for enum Drupal\experience_builder\JsonSchemaInterpreter\SdcPropJsonSchemaType in Drupal\experience_builder\JsonSchemaInterpreter\SdcPropJsonSchemaType::from() (line 131 of modules/contrib/experience_builder/src/PropShape/PropShape.php).

๐Ÿ› Bug report
Status

Active

Version

0.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada kiwad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kiwad
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arunsahijpal

    Hi @kiwad,
    I've installed the experience builder on drupal cms project but I didn't get any error.

  • got the same error with Drupal 11.1.7

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    The version in the issue summary is ancient ๐Ÿ˜…

    Without concrete steps to reproduce on the latest release of XB this is not actionable Iโ€™m afraid ๐Ÿ™ˆ

  • Status changed to Closed: cannot reproduce about 1 month ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • ๐Ÿ‡ญ๐Ÿ‡บHungary nevergone Nyรญregyhรกza, Hungary, Europe

    Steps to reproduce:

    PHP 8.3.6, Composer 8.3.6

    1. Download latest Drupal (11.2.2): composer create-project drupal/recommended-project .
    2. Install Drush (optional): composer require drush/drush
    3. Install Drupal 11.2.2 with Standard profile: drush si standard
    4. Install latest Experience Builder (0.5.0-alpha1): composer require 'drupal/experience_builder:^0.5@alpha'
    5. Download latest Radix theme (6.0.2): composer require 'drupal/radix:^6.0'
    6. Visit /admin/appearance form, install and set as default Radix theme
    7. Go to /admin/modules page and enable Experience Builder module
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands balintbrews Amsterdam, NL

    I took a quick look at the SDCs in the Radix theme, and I spotted something that might cause this. It's just a guess.

    Here are three SDCs that have props with an enum attribute and their type defined as an array:

    1. carousel.component.yml
    2. image.component.yml
    3. page-content.component.yml

    My guess is that \Drupal\experience_builder\JsonSchemaInterpreter is not expecting type as an array, or at least it's not expecting it when there is an enum attribute.

  • ๐Ÿ‡ญ๐Ÿ‡บHungary nevergone Nyรญregyhรกza, Hungary, Europe

    Radix 6.0.2 SDC components:

    Wrong:

    • accordion
    • badge
    • block
    • breadcrumb
    • button
    • button-group
    • card
    • comment
    • details
    • dropdown
    • field
    • field-comment
    • fieldset
    • figure
    • form-element
    • form-element--label
    • form-element--radiocheckbox
    • heading
    • list-group
    • media
    • modal
    • nav-item
    • node
    • offcanvas
    • page
    • page-footer
    • page-title
    • select
    • spinner
    • taxonomy
    • toasts
    • views-view

    Ok:

    • alert
    • close-button
    • collapse
    • dropdown-menu
    • form
    • html
    • input
    • local-tasks
    • nav
    • navbar
    • navbar-brand
    • page-navigation
    • pagination
    • progress
    • radios
    • region
    • table
    • textarea
    • tooltips
    • user
    • views-view--grid
    • views-view--table
    • views-view--unformatted
  • ๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

    Related to โœจ How to pass content_attributes to SDC without it being shown in the XB UI Active (probably even duplicated)

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands balintbrews Amsterdam, NL

    So probably any SDC is problematic where a prop's type is an array. This, as I come to think about it more, may not be very surprising: XB's prop shape matching needs to result in a deterministic field type + settings, and a field widget. Allowing multiple types would require us to generate UI that allows the user to select the type first. But I'm getting out of my depth, so curious what @wim leers or @penyaskito say. ๐Ÿ™‚

  • ๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

    AFAIK array is supported, as far as items specify the type.

    See \Drupal\experience_builder\PropShape\PropShape::resolveSchemaReferences

    Not that sure when using several types (e.g. type:[string, array] for a prop

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands balintbrews Amsterdam, NL

    Updated the issue summary based on what we know so far. I think what I said in #7 should be ignored based on the subsequent comments and a quick testing I did.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    It needs more investigation to figure what exactly causes this error.

    The answer is AFAICT surprisingly simple: it's not valid JSON Schema! SDC uses a superset โ€” see @e0ipso's comment at #3352063-14: Allow schema references in Single Directory Component prop schemas โ†’ .

    The solution is โœจ How to pass content_attributes to SDC without it being shown in the XB UI Active , so marking this as a duplicate and tagged that as a beta blocker + contributed project blocker.

Production build 0.71.5 2024