0

Due to certain requirements, we are developing a custom module to handle node creation and deletion, using node_save() and node_delete() respectively. However when we add a Rule with the Rules module to perform certain tasks with the events "After saving new content" and "After deleting content", the event "After saving new content" is triggered with node_save() without problem, but the event "After deleting content" is never triggered at all with node_delete(). Anyone has any idea what could be going wrong here? Thanks.

1

Short inspection of rules code showed that it should be triggered after node delete:

function rules_entity_delete($entity, $type) {
  switch ($type) {
  ...
    case 'node':
      rules_invoke_event('node_delete--' . $entity->type, $entity);
      rules_invoke_event('node_delete', $entity);
      break;
  ...

(from events.inc)

Have you tried turning on rules debug to see what is happening? Go to admin/config/workflow/rules/settings and turn on Show debug information to Always.

Maybe the event is being invoked, but some of your condition is incorrect and it appears that nothing is happening.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.