https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityStor...

The invokeHook() method on EntityStorageBase is passing the entity type into the CRUD hooks.

This is not necessary, since $entity (also being passed in) has the type on it. Also, it isn't documented in the hook docs, and no implementation is expecting it.

So, let's remove it. (Note: This was suggested by Berdir in IRC; see also #2216535-15: Replace Node overview topic and Node API topic with Entity Hooks topic and following comment that will be there as soon as I file this issue.

I'll make a one-line patch and attach as soon as I get this issue filed so I have a node ID to name the patch file.

CommentFileSizeAuthor
#1 2295229-entity-invoke.patch691 bytesjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

FileSize
691 bytes
jhodgdon’s picture

Status: Active » Needs review
jhodgdon’s picture

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

I'm pretty sure this was accidently re-introduced by a refactoring or something.

We did remove this and we documented it here: https://www.drupal.org/node/1637540. So let's remove it again, nobody knows we still do this (I didn't).

jhodgdon’s picture

Plus, removing it did not cause any test failures. :) Always a good thing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed bf7b017 and pushed to 8.x. Thanks!

  • alexpott committed bf7b017 on 8.x
    Issue #2295229 by jhodgdon: Do not need to pass entity type to entity...

Status: Fixed » Closed (fixed)

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