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().

Files: 
CommentFileSizeAuthor
#1 1473024-post-insert-update-delete.patch5.05 KBDamien Tournoud
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new5.05 KB
PASSED: [[SimpleTest]]: [MySQL] 66 pass(es).
[ View ]

Here 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.

Minor:

+++ b/plugins/behavior/abstract.incundefined
@@ -80,13 +87,27 @@ interface EntityReference_BehaviorHandler {
+   * Act before inserting an entity reference field.

I think this line is wrong - "after updating"...

Also, do you think we should change the existing insert/ update to preInsert/ preUpdate for clarity?

Status:Needs review» Fixed

Merged 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.

Status:Fixed» Closed (fixed)

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