Skip to main content
added 916 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

It's not invoked when deleting a node, basing on the code for node_delete_multiple(); the only functions called from that function that involve hooks are the following ones:

    node_invoke($node, 'delete');
    module_invoke_all('node_delete', $node);
    module_invoke_all('entity_delete', $node, 'node');
    field_attach_delete('node', $node);

The function is called from node_delete().

Looking at the code for node_delete_confirm_submit(), the form submission hander executed when a node is being deleted from the node edit form through the "Delete" button, I notice the following code:

$node = node_load($form_state['values']['nid']);
node_delete($form_state['values']['nid']);

That would cause the implementations of hook_node_load() to be invoked, but as far as I can see, it would not cause hook_node_validate() (which is invoked from node_validate()) to be invoked.

It's not invoked when deleting a node, basing on the code for node_delete_multiple(); the only functions called from that function that involve hooks are the following ones:

    node_invoke($node, 'delete');
    module_invoke_all('node_delete', $node);
    module_invoke_all('entity_delete', $node, 'node');
    field_attach_delete('node', $node);

The function is called from node_delete().

It's not invoked when deleting a node, basing on the code for node_delete_multiple(); the only functions called from that function that involve hooks are the following ones:

    node_invoke($node, 'delete');
    module_invoke_all('node_delete', $node);
    module_invoke_all('entity_delete', $node, 'node');
    field_attach_delete('node', $node);

The function is called from node_delete().

Looking at the code for node_delete_confirm_submit(), the form submission hander executed when a node is being deleted from the node edit form through the "Delete" button, I notice the following code:

$node = node_load($form_state['values']['nid']);
node_delete($form_state['values']['nid']);

That would cause the implementations of hook_node_load() to be invoked, but as far as I can see, it would not cause hook_node_validate() (which is invoked from node_validate()) to be invoked.

Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

It's not invoked when deleting a node, basing on the code for node_delete_multiple(); the only functions called from that function that involve hooks are the following ones:

    node_invoke($node, 'delete');
    module_invoke_all('node_delete', $node);
    module_invoke_all('entity_delete', $node, 'node');
    field_attach_delete('node', $node);

The function is called from node_delete().