The trigger actions are wrongly executed.

If you check in the trigger_assignemts table then you realize than flag hooks are flag with action flag and unflag.
But when you are triggering the actions the code is triggering 'flag', 'unflag', 'flag_$flag->name', 'unflag_$flag->name', that don't exist as you check when running the _trigger_get_hook_aids() function.

There is only generic flag trigger actions with the type of flag in the $context, if you try to create a Drupal actions with flags at hand you will realize about this.

This was causing that flag activities with unflag were not working ( as it was my case).

CommentFileSizeAuthor
#1 trigger.diff1.29 KBmooffie
flag_actions.patch867 bytesjcmarco

Comments

mooffie’s picture

Title: Unflag actions and activity don't work » Triggered actions don't work
Priority: Normal » Critical
StatusFileSize
new1.29 KB

Indeed, the Trigger intergration is completely botched.

There are two problems:

  1. When calling _trigger_get_hook_aids(): the hook-name, as you pointed out, should be fixed as 'flag' (but you needlessly deleted the "Actions specifically for this flag" branch).
  2. When calling actions_do(): We must pass the flagged item (node, comment, etc.) as the second parameter.

Without both these fixes, our Trigger support doesn't work at all. How have this happened? I wonder.

I'm about to commit the following patch.

mooffie’s picture

I see that Flag 1.x too has this bug. But I'm going to fix only 2.x.

mooffie’s picture

Status: Needs review » Fixed

Committed.
http://drupal.org/cvs?commit=454536

The D7 fix may involve more than a straight port, so I'll do this at #947392: D7: Make Actions/Trigger work.

Status: Fixed » Closed (fixed)

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