Support Drupal 10.3 SDC deprecation

Created on 24 June 2024, 3 months ago
Updated 5 September 2024, 23 days ago

Problem/Motivation

Hitting the following error when updating to Drupal 10.3

TypeError: Drupal\cl_editorial\NoThemeComponentManager::__construct(): Argument #1 ($pluginManager) must be of type Drupal\sdc\ComponentPluginManager, Drupal\Core\Theme\ComponentPluginManager given, called in /var/www/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\cl_editorial\NoThemeComponentManager->__construct() (line 23 of modules/contrib/cl_editorial/src/NoThemeComponentManager.php).

Proposed resolution

  • Switch from sdc to core in namespaces.

Maybe a new branch to support components (SDC) in Drupal core, and keep the old branch to work with the sdc

Remaining tasks

  • File an issue
  • Patch/MR
  • Test
  • Review

User interface changes

API changes

Data model changes

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

heddn Nicaragua

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

Merge Requests

Comments & Activities

  • Issue created by @heddn
  • Status changed to Needs review 3 months ago
  • 🇯🇴Jordan Qusai Taha Amman

    Attach a patch for the fix

  • Status changed to RTBC 3 months ago
  • 🇧🇷Brazil carolpettirossi Campinas - SP

    I was facing this error:

    TypeError: Drupal\cl_editorial\NoThemeComponentManager::__construct(): Argument #1 ($pluginManager) must be of type Drupal\sdc\ComponentPluginManager, Drupal\Core\Theme\ComponentPluginManager given, called in /var/www/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\cl_editorial\NoThemeComponentManager->__construct() (line 23 of modules/contrib/cl_editorial/src/NoThemeComponentManager.php).
    

    The MR code solved the error.

  • Status changed to Needs work 3 months ago
  • 🇧🇷Brazil carolpettirossi Campinas - SP

    Sorry, I moved to RTBC too soon.

    I'm now facing a different error when I access "Manage Display" tab on the Basic Page CT:

    AssertionError: assert($component_manager instanceof ComponentPluginManager) in assert() (line 58 of modules/contrib/sdc_display/sdc_display.module).
    sdc_display_field_formatter_third_party_settings_form(Object, Object, 'default', Array, Object) (Line: 162)
    Drupal\field_ui\Form\EntityViewDisplayEditForm->Drupal\field_ui\Form\{closure}(Object, 'sdc_display') (Line: 396)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith('field_formatter_third_party_settings_form', Object) (Line: 168)
    Drupal\field_ui\Form\EntityViewDisplayEditForm->thirdPartySettingsForm(Object, Object, Array, Object) (Line: 451)
    Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow(Object, Array, Object) (Line: 41)
    Drupal\field_ui\Form\EntityViewDisplayEditForm->buildFieldRow(Object, Array, Object) (Line: 227)
    Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->buildFieldRow(Object, Array, Object) (Line: 213)
    Drupal\field_ui\Form\EntityDisplayFormBase->form(Array, Object) (Line: 47)
    
  • Status changed to Needs review 3 months ago
  • 🇧🇷Brazil carolpettirossi Campinas - SP

    I just realized that the error is not on cl_editorial, and it is, in fact, on sdc_display.

    Created an issue here: https://www.drupal.org/project/sdc_display/issues/3458639 🐛 The module is not compatible with Drupal 10.3.0 Active

    Moving to "Needs review" for some other community members to review the patch provided if they use cl_editorial only.

  • 🇦🇷Argentina tongadall

    I was facing this error #4 too en Drupal 10.3, and #3 path solved the error.

  • 🇦🇷Argentina tongadall

    Note for anyone who needs to know how to apply the patches, add these patches to composer.json:

        "extra": {
        ...
            "patches": {
                "drupal/cl_editorial": {
                    "#3456850: Support Drupal 10.3 SDC deprecation": "https://git.drupalcode.org/project/cl_editorial/-/merge_requests/12.patc"
                }
            },
        },
    

    And execute:

    composer update drupal/cl_editorial

    See the doc https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...

  • My composer

     "extra": {  
            "patches": {
                "drupal/cl_editorial": {
                    "#3456850: Support Drupal 10.3 SDC deprecation": "https://git.drupalcode.org/project/cl_editorial/-/merge_requests/12.patch"
                }
            },
    ... other items
    }

    > composer update drupal/cl_editorial
    Loading composer repositories with package information
    Updating dependencies
    Nothing to modify in lock file
    Installing dependencies from lock file (including require-dev)
    Nothing to install, update or remove
    Generating autoload files

    visit the site - unexpected error, php log shows same error. How can I tell if a patch has been applied?

  • 🇦🇷Argentina tongadall

    Can we release a new beta version with this patch so this module work in Drupal 10.3 out of the box?

  • Status changed to RTBC about 1 month ago
  • 🇯🇴Jordan Rajab Natshah Jordan

    Thank you, for the MR12 and the static patch file.
    It's working.
    Using the static patch file with Composer Patches, which identical of MR12

  • 🇦🇷Argentina tongadall

    Hello @rajab. Out of curiosity, why do you use a static version of the patch and not the MR version? The MR version may make it more unstable, but it will include the latest changes from the patch which should be good. Is it because of this instability that you prefer the static version?

  • 🇯🇴Jordan Rajab Natshah Jordan

    This is a better practice rule in my company

    Patches from drupal.org merge request URLs are dangerous?
    Choosing direct merge requests over patching isn't the best option for maintaining stability, especially considering Drupal's shift from patching to merge requests.
  • 🇦🇷Argentina tongadall

    Thanks Rajab, perfect make sense.

Production build 0.71.5 2024