[2.0.5]Β Test the SDC Variants of Drupal 11.2

Created on 6 May 2025, 3 months ago

Problem/Motivation

✨ Introduce component variants to SDC Active was merged in Core and will be shipped with 11.2

Proposed resolution

Is it compatible with our own variant system ?

API changes

We are still supporting Drupal 10.3+ so this issue will not be the opportunity of removing our own impelmnattion and any change we do must be compatible with Drupal 10.3+

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France pdureau Paris

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

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • πŸ‡©πŸ‡ͺGermany sharique

    I did the quick testing for this as follows.

    • Installed latest Drupal core 11.x
    • Create a new theme
    • Created a simple alert component
    • Installed UI pattern layout and layout builder
    • Added alert component in article display mode using layout builder twice with different variants
    • Both variants are displayed correctly.

    There is one error I got when enabling module, I'll create a separate ticket for it

  • πŸ‡ΊπŸ‡¦Ukraine SmovS Lutsk

    Thank you @sharique, for testing and your feedback.

    I tested it a bit as well, and here are my results:
    Tested env:
    Crupal Core: 11.2-dev
    PHP: 8.3.19
    UI Patterns: 2.0.3

    During the installation of the ui_patterns 2.0.3, I got an error about the compatibility with the Drupal Core implementation (ComponentPluginManager::processDefinitionCategor)

    Also, I installed and tested these themes as origins for the components :
    ui_suite_bootstrap (5.1.0-beta1)
    ui_suite_material (2.0.0-beta1)
    ui_suite_daisyui (5.0.0-alpha2)

    Each of them was installed and worked without errors.

    I can confirm variants like primary, danger, warning, etc., from the abovementioned themes work without issues in Drupal 11.2.

  • πŸ‡«πŸ‡·France pdureau Paris

    Great, thanks both.

    ComponentPluginManager::processDefinitionCategory is managed in an other issue: πŸ› PHPSTAN next minor warnings Active

  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France pdureau Paris

    Grimreaper has found something !

  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    We encountered:

    Drupal\Core\Render\Component\Exception\InvalidComponentException: [props.properties.variant.enum] There must be a minimum of 1 items in the array, 0 found in Drupal\Core\Theme\Component\ComponentValidator->validateDefinition() (line 144 of core/lib/Drupal/Core/Theme/Component/ComponentValidator.php).
    

    In vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php:

        public function resolveRef(string $ref, $resolveStack = [])
        {
            ...
            // get & process the schema
            $refSchema = $this->getSchema($fileName);
            foreach ($jsonPointer->getPropertyPaths() as $path) {
    

    $jsonPointer->getPropertyPaths() is empty and $refSchema = $this->getSchema($fileName); get empty enum.

    Removing special $ref for variant fixes the problem. Somehow no problem with other special $ref of UI Patterns 2.

  • πŸ‡«πŸ‡·France pdureau Paris

    that was a weird one, but i have merged

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

Production build 0.71.5 2024