use EntityTypeManagerInterface instead of EntityTypeManager

Created on 12 November 2018, over 6 years ago
Updated 3 October 2024, 9 months ago

When using the purl module in conjunction with a module that substitutes the EntityTypeManager service, purl will produce a fatal error initialising the container because \Drupal\purl\ContextHelper expects an argument of the type EntityTypeManager.

For instance using the devel webprofiler:
TypeError: Argument 1 passed to Drupal\purl\ContextHelper::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given

This can easily be fixed by demanding an argument of the type EntityTypeManagerInterface.

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands finne Amsterdam

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States rbrandon

    finne this is no longer an issue in the current 8.x branch, the ContextHelper no longer passes the EntityTypeManager in construct, when I update the getStorage method to use dependency injection correctly I will use the interface.

Production build 0.71.5 2024