Closed (duplicate)
Project:
Flag
Version:
6.x-1.x-dev
Component:
Actions integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2009 at 17:52 UTC
Updated:
18 Sep 2009 at 21:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
sirkitree commentedAh, very nice. +1
Got a couple problems applying though. Empty line and offset fuzz.
Here it is again applied to latest dev.
Comment #2
quicksketchWould this be fixed by the (much larger) patch in #397464: Action for executing a flag? The trigger implementation was written before I really knew how trigger was supposed to work. As it is currently, it doesn't do much of anything helpful at all.
Comment #3
Scott Reynolds commentedNo as that patch doesn't address the need for more input into $context.
Basically, this patch adds in the 'relevant_action_objects' to the context.
Comment #4
quicksketchI'm really not enthusiastic about trying to follow the squirrely actions/trigger function chain at the moment but I'll be happy to take your word for reasonings. :-)
Before this patch the context looks like this:
After the patch it looks like this:
Is it unusual that this $context variable now contains some objects and some strings? Especially considering previously $context['flag'] was a string, now it's an object.
In flag_actions.module, we have a section of code like this:
So we actually set flag-action to a separate item in the context, rather than bunching it into the root level. Would that help with your use-case while not breaking other existing actions? I'm not sure they're being used for anything (by trigger.module) the way they're written currently.
Comment #5
Scott Reynolds commentedSo the reason why i didn't nuke the current context but rather, added stuff is because I didn't want to break current trigger > actions.
But if thats not a concern, the yes the code from flag_actions would work wonderfully.
In the context array , I need objects that can be used in token_replace. So having the account, and the relevant_action_objects() achieves that aim.
Comment #6
Scott Reynolds commentedmissing from the trigger implementation is 'op'
http://drupal.org/node/375833
Comment #7
Scott Reynolds commented..and $aids = _trigger_get_hook_aids($action, $action); only works when you do a flag action not an unflag action
it needs to be $aids = _trigger_get_hook_aids('flag', $action);
... Im moving all this over to the Activity integration, because I don't discover these bugs without that. It makes it a bigger patch but its all for the good. And given that I highly doubt anyone uses flags Trigger implementation anywhere, Activity would really be the first one.
#495526: Activity2 Integration
Comment #8
quicksketchLet's just mark this duplicate if it's being included entirely in #495526: Activity2 Integration. I'm fine with the merge because the new patch is still only 5k.