EntityManager is depreciated in 8.0 so we should be using EntityTypeManager in the code base

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pavan B S created an issue. See original summary.

Pavan B S’s picture

Assigned: Pavan B S » Unassigned
Status: Active » Needs review
FileSize
3.66 KB

Applying the patch, please review.

Peter Majmesku’s picture

Status: Needs review » Needs work

First of all: thanks for providing a patch. Yes, the EntityManager is deprecated.

However, your patch is not complete. If I apply your patch and save an new taxonomy term via the form, I get this error:

TypeError: Argument 3 passed to Drupal\permissions_by_term\NodeAccess::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\Core\Entity\EntityManager given, called in /home/jepster/PhpstormProjects/pbt-d8/core/lib/Drupal/Component/DependencyInjection/Container.php on line 284 in Drupal\permissions_by_term\NodeAccess->__construct() (line 58 of /home/jepster/PhpstormProjects/pbt-d8/modules/permissions_by_term/src/NodeAccess.php)

What I can see so far is, that the module's services aren't modified according to the EntityTypeManager in permissions_by_term.services.yml.

Please solve this and test PbT's functionality after your implementation.

jeetendrakumar’s picture

Assigned: Unassigned » jeetendrakumar
jeetendrakumar’s picture

Status: Needs work » Needs review
FileSize
3.79 KB

Please find updated patch file.

jeetendrakumar’s picture

Assigned: jeetendrakumar » Unassigned
bapi_22’s picture

Status: Needs review » Needs work

Hi jeetendrakumar,

It seems, you have not change the parameters in services.yml files. It should be like

permissions_by_term.access_check:
class: Drupal\permissions_by_term\AccessCheck
arguments: ['@entity_type.manager', '@database']
permissions_by_term.node_access:
class: \Drupal\permissions_by_term\NodeAccess
arguments: ['@permissions_by_term.access_storage', '@permissions_by_term.node_access_record_factory', '@entity_type.manager', '@permissions_by_term.access_check', '@database']

Also note that getFieldDefinition is not a method under EntityTypeManager Class. Please call this method from \Drupal\Core\Entity\EntityFieldManagerInterface

Thanks

prathibhab.cdac’s picture

Patch with parameter updated in services.yml

bapi_22’s picture

Status: Needs work » Needs review

Peter Majmesku’s picture

Status: Needs review » Fixed

I have applied the patch on the dev branch. Thanks!

Status: Fixed » Closed (fixed)

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