Problem/Motivation

I have installed and activated WebProfiler and COOKiES Consent Management, and it looks like constructor for CookiesServiceEntityForm requires an EntityTypeManager instance as an argument, where WebProfiler injects a EntityManagerWrapper one.

I receive this error

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\cookies\Form\CookiesServiceEntityForm::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given, called in /app/web/modules/contrib/cookies/src/Form/CookiesServiceEntityForm.php on line 47 in Drupal\cookies\Form\CookiesServiceEntityForm->__construct() (line 34 of modules/contrib/cookies/src/Form/CookiesServiceEntityForm.php). 

Steps to reproduce

Activate both WebProfiler and COOKiES Consent Management, and go to COOKiES Service entities page and try to edit an existing service, or add a new one (/admin/structure/cookies_service/add)

Proposed resolution

Since it implements EntityTypeManagerInterface, it looks like it would be better to accept EntityTypeManagerInterface instead in the CookiesServiceEntityForm constructor.

It looks like another module for Cookies management has the same problem (issue #3131290)

Comments

fadeslayer created an issue. See original summary.

fadeslayer’s picture

  • JFeltkamp committed 14f86f0 on 1.0.x
    Issue #3215774: Compatibility issues with webprofiler
    
jfeltkamp’s picture

Status: Active » Needs review

Changed dependency from EntityTypeManager to EntityTypeManagerInterface.

Fixed in 1.0.x and released in >= 1.0.10

anybody’s picture

Status: Needs review » Fixed

@fadeslayer can you tell if this fixes the issue for you?

Status: Fixed » Closed (fixed)

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