The entity.manager service is deprecated in favour of the entity_type.manager service.

I have a Drupal 9 site and tried to setup this module but got the following error when trying to add a view via Paragraphs onto a node:

The website encountered an unexpected error. Please try again later.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "entity.manager". in Drupal\Component\DependencyInjection\Container->get() (line 151 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal::service('entity.manager') (Line: 311)
Drupal\viewsreference\Plugin\Field\FieldWidget\ViewsReferenceWidget->getViewDisplays('files') (Line: 98)
Drupal\viewsreference\Plugin\Field\FieldWidget\ViewsReferenceWidget->fieldElement(Object, 0, Array, Array, Object) (Line: 31)
Drupal\viewsreference\Plugin\Field\FieldWidget\ViewsReferenceWidget->formElement(Object, 0, Array, Array, Object) (Line: 342)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 209)
CommentFileSizeAuthor
#2 3133637-use-entity_type-service.patch830 bytesdan2k3k4

Comments

dan2k3k4 created an issue. See original summary.

dan2k3k4’s picture

StatusFileSize
new830 bytes

Here's a patch that changes to use the `entity_type.manager` service

skymen’s picture

Status: Active » Reviewed & tested by the community

@dan2k3k4 Thanks. Works on Drupal 9.

joekers’s picture

Thanks for the patch - committing to 2.x branch.

  • joekers committed 84ca0fe on 8.x-2.x
    Issue #3133637 by dan2k3k4: The entity.manager service is deprecated.
    
joekers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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