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

CommentFileSizeAuthor
#3 3456850-3.patch8.1 KBqusai taha
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:

  • 1.x Comparecompare
  • 2.x Comparecompare
  • 3456850-support-drupal-10.3 Comparechanges, plain diff MR !12

Comments

heddn created an issue. See original summary.

qusai taha’s picture

Status: Active » Needs review
StatusFileSize
new8.1 KB

Attach a patch for the fix

carolpettirossi’s picture

Status: Needs review » Reviewed & tested by the community

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.

carolpettirossi’s picture

Status: Reviewed & tested by the community » Needs work

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)
carolpettirossi’s picture

Status: Needs work » Needs review

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

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

tongadall’s picture

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

tongadall’s picture

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.patch"
            }
        },
    },

And execute:

composer update drupal/cl_editorial

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

digitaltodd’s picture

posted a comment - re: applying the above patch - in the wrong place, so I deleted it and reentered at
https://www.drupal.org/project/sdc_display/issues/3458639

tongadall’s picture

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

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

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

tongadall’s picture

Hello @rajab. Out of curiosity, why do you use a static version of the patch and not the MR version as I suggested in #8? 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?

rajab natshah’s picture

Gastón, nice to ask. I think you got it right.

This is a better practice rule for patching 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.
tongadall’s picture

Thanks Rajab, perfect make sense.

pcambra’s picture

I think this should grant a 3.x branch that requires drupal >10.3

  • pcambra committed 983a9ee8 on 2.x
    Issue #3456850: Support Drupal 10.3 SDC deprecation
    

  • pcambra committed 4f8806ca on 1.x
    Issue #3456850: Support Drupal 10.3 SDC deprecation
    
pcambra’s picture

Version: 2.x-dev » 3.x-dev

  • pcambra committed 2c5cc2e1 on 3.x
    Issue #3456850 by pcambra: Support Drupal 10.3 SDC deprecation
    
pcambra’s picture

Status: Reviewed & tested by the community » Fixed

Many thanks to all, I've now released a 3.x version and tagged a rc with this.

tongadall’s picture

@pcambra super! thanks to all.

liam morland’s picture

This should also be done in submodule sdc_tags.

tongadall’s picture

And maybe in module sdc_block to solve this issue? https://www.drupal.org/project/sdc_block/issues/3456851

Status: Fixed » Closed (fixed)

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

liam morland’s picture

The merge request contains the change on 2.x to update core_version_requirement in sdc_tags. A similar change should also be done in 3.x.

Does this actually work in Drupal 9? If not, core_version_requirement should not declare that compatibility.

heddn’s picture

That's all fine and well to commit the changes for here, but https://git.drupalcode.org/project/sdc_block/-/merge_requests/3 is now left out and needs some love too.

pcambra’s picture

One at at a time, thanks heddn.

@liam morland, thanks for noticing that, I've pushed a 3.0.0-rc2 tag with this.