implement hook_entity_presave() for entities provided by the CRUD API

CommentFileSizeAuthor
#2 entity_presave.patch649 bytesfago
#1 drupal-entity-presave.patch13.19 KBfago

Comments

fago’s picture

Status: Active » Needs review
StatusFileSize
new13.19 KB
fago’s picture

StatusFileSize
new649 bytes

ops, this is the right one.

sun’s picture

Status: Needs review » Reviewed & tested by the community
+++ includes/entity.controller.inc
@@ -416,7 +416,7 @@ class EntityAPIController extends DrupalDefaultEntityController implements Entit
+    if ($hook == 'insert' || $hook == 'update' || $hook == 'presave' || $hook == 'delete') {

However, wouldn't it make sense if presave came first, before insert/update?

Powered by Dreditor.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, I moved it to the beginning and committed it.

Status: Fixed » Closed (fixed)

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