Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | rules_entity_events.patch | 5.98 KB | fago |
#2 | rules_entity_events.patch | 5.98 KB | fago |
#1 | rules_entity_events.patch | 5.82 KB | fago |
#1 | entity_rules_events.patch | 1.05 KB | fago |
Comments
Comment #1
fagoAttached are patch for Rules + the Entity API.
Comment #2
fagoadded a comment explaining why do it that way + including a pointer to this issue. Updated rules patch attached.
Comment #3
fagosome more docu fixes spotted by klausi in real-time.
Comment #4
klausiAck
Comment #5
fagoand committed, thx. :)
Comment #7
lollipopp CreditAttribution: lollipopp commentedI 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