To avoid any troubles with invoking entity_save() on hook_entity_insert() we have to make sure Rules operates last - else modules' update hooks might be invoked before their insert hooks.

For that Rules has already a rather high weight, however if modules implement the generic entity hooks they are currently still operating after Rules - as they come after the entity-type specific hooks. To fix, we need to use the generic entity hooks too for invoking rules events.

Entity type providing modules should just invoke the rules-event last. For the entity API we can fix that generally.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Active » Needs review
FileSize
1.05 KB
5.82 KB
5.82 KB

Attached are patch for Rules + the Entity API.

fago’s picture

FileSize
5.98 KB

added a comment explaining why do it that way + including a pointer to this issue. Updated rules patch attached.

fago’s picture

FileSize
5.98 KB

some more docu fixes spotted by klausi in real-time.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Ack

fago’s picture

Status: Reviewed & tested by the community » Fixed

and committed, thx. :)

Status: Fixed » Closed (fixed)

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

lollipopp’s picture

Component: Rules Engine » Rules Core

I seem to have the same problem with webforms which does not seem to be an entity (inserting,not updating).
Is there another workaround I could develop / try?
For more information, please have a look at
this ticket