Problem/Motivation

When I try to enable module I have this error on all site

Fatal error: Trait "Symfony\Component\DependencyInjection\ContainerAwareTrait" not found in /staging/releases/32/web/modules/contrib/bootstrap_layouts/src/BootstrapLayoutsPluginManager.php on line 16

Steps to reproduce

try to enable module

CommentFileSizeAuthor
#14 3481450-14.patch12.83 KBsmulvih2
#12 3481450-12.patch11.54 KBsmulvih2
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:

Comments

svicer created an issue. See original summary.

svicer’s picture

Issue summary: View changes
raveen_thakur51’s picture

@svicer, I am also getting the same error when i am enabling the module.
https://prnt.sc/dZcsHDUHtazn

I am using drupal version 11

sarwan_verma’s picture

Assigned: Unassigned » sarwan_verma

rajab natshah made their first commit to this issue’s fork.

rajab natshah’s picture

Title: Cannot install module in drupal 11 » Fix Drupal 11 support by removing any use of ContainerAwareTrait and ContainerAwareInterface by using dependency injection instead

rajab natshah’s picture

Status: Active » Needs work

Raveen, Sarwan, thanks for reporting and following up on the issue.

I created a starting point MR (basic changes).
For sure we need to do more than that.

smulvih2 changed the visibility of the branch 3481450-cannot-install-module to hidden.

smulvih2’s picture

Status: Needs work » Needs review

Sorry didn't mean to hide visibility of the branch, accidently clicked the wrong link. Add fix to the MR, broken reference to ContainerAwareInterface.

smulvih2 changed the visibility of the branch 3481450-cannot-install-module to active.

smulvih2’s picture

StatusFileSize
new11.54 KB

Adding lates MR changes to patch to use in my project.

mlzr’s picture

Hello, thanks for the good work for the community!

If I deploy this patch I have a new error. If i go to the page /backend/modules/uninstall then the website reports "The website encountered an unexpected error. Try again later.".

A peek in the page /backend/reports/dblog (the log) I find this:
Error: Call to undefined method Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Ds::setContainer() in Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\BootstrapLayoutsHandlerBase->__construct() (line 22 of /home/map/public_html/modules/contrib/bootstrap_layouts/src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerBase.php).

I am not a coder so I hope you can do something about it. Thanks.

Marcel

smulvih2’s picture

StatusFileSize
new12.83 KB

Ran into the same issue as #13, although in my case it was through PageManager.php instead of Ds.php. Fixed the issue in the PR and attaching a new patch to use in my project.

mlzr’s picture

Thanks smulvih2 / Stephen!
I used the new 3481450-14.patch and now it works fine, no errors anymore.

Thank you for your time!
Marcel

smulvih2’s picture

Status: Needs review » Reviewed & tested by the community

Based on feedback from #15, and because I'm using this in my distro to fix the reported error, setting this to RTBC.

  • rajab natshah committed b0a21bd8 on 8.x-5.x
    Issue #3481450: Fix Drupal 11 support by removing any use of...
rajab natshah’s picture

Assigned: sarwan_verma » Unassigned
Status: Reviewed & tested by the community » Fixed
rajab natshah’s picture

Thank you :)
Merged
✅ Released Bootstrap Layouts 8.x-5.5

Status: Fixed » Closed (fixed)

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