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.
The insert and update hooks that the Field API implements are actually pre-insert and pre-update hooks. This is not what most of the behavior implementations will require.
I suggest we emulate the corresponding post insert hooks implemented via hook_field_attach_insert()
and hook_field_attach_update()
.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1473024-post-insert-update-delete.patch | 5.05 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere is what I suggest in form of a patch.
I'm going to need that in the Tree module, that needs to react on post-update and insert.
Comment #2
amitaibuMinor:
I think this line is wrong - "after updating"...
Comment #3
amitaibuAlso, do you think we should change the existing insert/ update to preInsert/ preUpdate for clarity?
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedMerged into 7.x-1.x (with the correction of #2). I don't think we should touch the existing hooks, I would like to break the API as little as possible.