From 252148a7064f2d28b893332d84f9191867edd604 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sat, 14 May 2011 12:51:34 -0400 Subject: [PATCH] - Patch #988030 by mr.baileys, linclark: document correct sequence of hooks in node deletion. --- modules/node/node.api.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 906dda1fda88..3e8029cfc765 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -37,6 +37,7 @@ * - Creating a new node (calling node_save() on a new node): * - field_attach_presave() * - hook_node_presave() (all) + * - hook_entity_presave() (all) * - Node and revision records are written to the database * - hook_insert() (node-type-specific) * - field_attach_insert() @@ -47,6 +48,7 @@ * - Updating an existing node (calling node_save() on an existing node): * - field_attach_presave() * - hook_node_presave() (all) + * - hook_entity_presave() (all) * - Node and revision records are written to the database * - hook_update() (node-type-specific) * - field_attach_update() @@ -69,6 +71,9 @@ * - hook_entity_prepare_view() (all) * - field_attach_view() * - hook_node_view() (all) + * - hook_entity_view() (all) + * - hook_node_view_alter() (all) + * - hook_entity_view_alter() (all) * - Viewing multiple nodes (calling node_view_multiple() - note that the input * to node_view_multiple() is a set of loaded nodes, so the Loading steps * above are already done): @@ -77,13 +82,16 @@ * - hook_view() (node-type-specific) * - field_attach_view() * - hook_node_view() (all) + * - hook_entity_view() (all) * - hook_node_view_alter() (all) + * - hook_entity_view_alter() (all) * - Deleting a node (calling node_delete() or node_delete_multiple()): * - Node is loaded (see Loading section above) - * - Node and revision information is deleted from database * - hook_delete() (node-type-specific) * - hook_node_delete() (all) + * - hook_entity_delete() (all) * - field_attach_delete() + * - Node and revision information are deleted from database * - Deleting a node revision (calling node_revision_delete()): * - Node is loaded (see Loading section above) * - Revision information is deleted from database @@ -453,9 +461,10 @@ function hook_node_operations() { /** * Respond to node deletion. * - * This hook is invoked from node_delete_multiple() after the node has been - * removed from the node table in the database, after the type-specific - * hook_delete() has been invoked, and before field_attach_delete() is called. + * This hook is invoked from node_delete_multiple() after the type-specific + * hook_delete() has been invoked, but before hook_entity_delete and + * field_attach_delete() are called, and before the node is removed from the + * node table in the database. * * @param $node * The node that is being deleted. -- GitLab