When advanced action is deleted first, trigger cannot unassign. Please confirm it.

steps:

  • create own advanced action at admin/settings/actions
  • assign trigger to created action at admin/build/trigger/node
  • delete that action at admin/settings/actions
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Takafumi’s picture

Priority: Normal » Critical

Encounters WSOD at triggered event when orphaned trigger remains. For this reason, this issue is critical.

Gábor Hojtsy’s picture

Title: When advanced action is deleted first, trigger cannot unassign » Advanced actions should be deassigned before deleted
FileSize
16.1 KB
8.42 KB

I can reproduce this issue. The problem is that when you remove an advanced action, it is not deassigned first from all triggers. This results in these interesting admin and delete confirm pages as attached.

Gábor Hojtsy’s picture

Why does this happen?

- When you delete an action, system_actions_delete_form_submit() is invoked.
- This invokes actions_delete($aid), which deletes the action.
- actions_delete($aid) also does a module_invoke_all('actions_delete', $aid); call, which is supposed to be used by modules to react on the deletion
- trigger module does not implement this hook, but it should implement it to remove all trigger associations for this action as well

That's our problem.

Gábor Hojtsy’s picture

Title: Advanced actions should be deassigned before deleted » Advanced actions should be deassigned when deleted
Status: Active » Needs review
FileSize
699 bytes

Patch cooked, tested, works for me.

Gábor Hojtsy’s picture

Note that aid is a varchar column, so we need to use this string check. It is not a usual integer ID.

Takafumi’s picture

Status: Needs review » Reviewed & tested by the community

Great, a patch works properly.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks for testing.

Takafumi’s picture

Status: Fixed » Closed (fixed)

thanks.