Unflagging a node with Rules Scheduler I have got an issue unflagging a node with Rules scheduler when triggering it with cron. The node gets unflagged just fine if we execute the component manually, however, if I schedule it to unflag the node like 2 minutes after triggering the Rule, it doesn't unflag the node.  I ran cron multiple times, refreshed the page, but nothing.

I have done some preliminary testing and found out that flag_rules_action_info() is just not being called at all when executing this through cron. I have checked permissions and every thing looks good there. Would appreciate it if you guys could give me some input as to what might be the problem when triggering it with cron. I have included the rules debug info below and an export of the rule and the component. Thanks.

Debug Info:

0 ms Scheduled evaluation of action set my component, task Unbookmark 10..
90.748 ms Evaluating the action component_rules_my_component. [edit]
0 ms Evaluating action set my component.
0.473 ms Evaluating the action component_rules_my_component. [edit]
0.528 ms Not evaluating action set my component to prevent recursion. [edit]
1.07 ms Evaluating the action flag_unflagnode. [edit]
5.439 ms Evaluating the action add_badge_by_name. [edit]
7.16 ms Finished evaluation of action set my component.
98.707 ms Evaluating the action flag_unflagnode. [edit]
98.982 ms Evaluating the action add_badge_by_name. [edit]
116.401 ms Finished evaluation of action set my component, task Unbookmark 10..


Component Export:

{ "rules_my_component" : {
"LABEL" : "my component",
"PLUGIN" : "action set",
"REQUIRES" : [ "rules", "flag", "user_badges" ],
"ACCESS_EXPOSED" : "1",
"USES VARIABLES" : { "node" : { "label" : "node", "type" : "node" } },
"ACTION SET" : [
{ "component_rules_my_component" : [ ] },
{ "flag_unflagnode" : {
"flag" : "bookmarks",
"node" : "10",
"flagging_user" : [ "site:current-user" ],
"permission_check" : 1
}
},
{ "add_badge_by_name" : { "badge" : "4", "user" : [ "node:author" ] } }
]
}
}


Rules Export:

{ "rules_test_scheduler" : {
"LABEL" : "test scheduler",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "rules_scheduler", "flag" ],
"ON" : [ "flag_flagged_bookmarks" ],
"IF" : [
{ "entity_is_of_type" : { "entity" : [ "flagged-node" ], "type" : "node" } },
{ "node_is_of_type" : {
"node" : [ "flagged-node" ],
"type" : { "value" : { "blog" : "blog" } }
}
}
],
"DO" : [
{ "drupal_message" : { "message" : "this works" } },
{ "schedule" : {
"component" : "rules_my_component",
"date" : "+2 minutes",
"identifier" : "Unbookmark [flagged-node:nid].",
"param_node" : [ "flagged-node" ]
}
}
]
}
}
I have figured this out myself.  Please refer to Comment #5 in Issue 2094541 for the answer, located at the following link:
https://drupal.org/node/2094541#comment-7955705
Here is what it says:

Finally, figured this out! The problem is, we're not supplying the required parameters to the Rules component. If you have given it only 'node' as the parameter, then, when you add the action to 'Unflag a Node', you must give the 'User on whose behalf to flag' a data selector such as 'node:author'. You can't do something like 'site:current-user' because that parameter is not available to the component when run through Cron.
Once you give it the required parameters, it should unflag the node through Cron.