Hi,
I'm in need of some help. I need to fire a rule on entity after it has saved, both hook_entity_insert and hook_entity_update must be implemented.
On entity insert, I can't get the entity field values, on entity_update I can get the values but I need to fire the rule on entity insert with the field values.
There is a module that implements this event: https://www.drupal.org/project/hook_post_action
Is it possible to add this module as an extent for Rule Events?
- hook_entity_postsave
- hook_entity_postinsert
- hook_entity_postupdate
- hook_entity_postdelete
- hook_node_postsave
- hook_node_postinsert
- hook_node_postupdate
- hook_node_postdelete
I can help with the testing and some of the work if you point me in the right direction.
Thanks,
Kind Regards,
Alex
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | potato-stamp.jpg | 147.49 KB | lexsoft00 |
Comments
Comment #2
yseki commentedHi Alex,
Thanks for the suggestion. Those triggers implementation seems to pretty straight forward and can be developed as an optional module inside business_rules. Based on that, I can't see any reason to not implement it asap. Hopefully I'm gonna do it on my next update.
I would really appreciate your tests on this feature.
Best regards,
Yuri Seki
Comment #3
lexsoft00 commentedHi @yuriseki,
That's great news! I would gladly help with anything I can.
I've done a test now by adding a hook in .module:
And adding the class to
But it seems to have the same result to entity insert no real difference that I could spot. I'm starting to think that this will not solve my problem. I've actually got some results from getting the values on Entity Insert without adding a bundle to the action and using token for values.
I have a rule to programmatically create a node,
when the node is inserted I want to send a confirmation email with the field values of an entity reference of the current node,
which I need to custom query the DB.
Done a custom Action Rule for that but could not query the DB because I was getting NULL on field values on the current entity using bundle on Action.
Sorry for the long post, here's a drupal potato.
