About the warning text, is it self-conflicting. Do you mean

when the entity/node is saved

in the first part?

Both sentences mean different things about "when node is deleted", don't they?

WARNING: The _postsave, _postinsert and _postupdate hooks are also called when the entity/node is deleted, as there is no way to find out whether the entity/node is actually saved/inserted/updated. However, the module does only call the delete hooks when the entity/node is actually deleted from database.

Comments

jusfeel created an issue. See original summary.

sinasalek’s picture

You expect _postinsert to be called only when the node is inserted. but it's called on all node actions (insert, update, delete) because due to drupal core limitations it's not possible to distinguish between these actions.

jusfeel’s picture

I tried to produce this situation but I can't.

So I add a watchdog under postinsert and postupdate and I deleted something. But I can't capture the watchdog.

Is my test valid?

jmuzz’s picture

Yeah I don't get this either... Is this problem unique to the Drupal 8 version? The intro page could specify that if it's the case.

I activated the module and the example module in Drupal 7. When I deleted a node only the delete hook was called. The other hooks are not being called except for when they're supposed to be.

sinasalek’s picture

No it actually originates from Drupal 7.
May the behavior of Drupal is changed. If non of you is experiencing the problem perhaps it is fixed and there is no need for the warning

  • sinasalek committed 6332061 on 8.x-1.x
    [#2786131] The warning in readme is no longer applicable to Drupal8 so...
sinasalek’s picture

Status: Active » Fixed

I removed the warning as per this issue

Status: Fixed » Closed (fixed)

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