Problem/Motivation

When webprofiler from devel is enabled, the lack of an interface causes this error.

TypeError: Argument 1 passed to Drupal\prevnext\PrevnextService::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given, called in /var/www/html/public/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 in Drupal\prevnext\PrevnextService->__construct() (line 36 of modules/contrib/prevnext/src/PrevnextService.php).

Steps to reproduce

Setup prevnext + enable webprofiler

Proposed resolution

Use an interface instead of a class

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork prevnext-3277266

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

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review
joelpittet’s picture

Title: PrevnextService::__construct() error with webprofiler » Use EntityTypeManagerInterface with PrevnextService::__construct() error to help webprofiler
antonio.bertolini’s picture

FYI,
I got the same problem with domain theme switch 2 days ago. That's the issue:

https://www.drupal.org/project/domain_theme_switch/issues/3293484

aronne made their first commit to this issue’s fork.

  • aronne committed a7a0260 on 2.0.x authored by joelpittet
    Issue #3277266: PrevnextService::__construct() error with webprofiler
    
aronne’s picture

Status: Needs review » Fixed
aronne’s picture

Status: Fixed » Closed (fixed)
joelpittet’s picture

Thanks @aronne! BTW you can leave the status "Fixed" and it will auto go to closed fixed after a couple weeks

https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-...