Problem/Motivation

In its user parameter description the "User who flagged the @label" rules action promises:
"For non-global flags, this is the user who flagged the @label. (For global flags, this argument is ignored.)"
However, for global flags the arguments is not ignored.
See flag_rules_action_fetch_entity_by_user().

Proposed resolution

Ignore the user parameter for global flags.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

czigor’s picture

Assigned: czigor » Unassigned
Status: Active » Needs review
FileSize
1.3 KB
shabana.navas’s picture

Status: Needs review » Reviewed & tested by the community

Yes, you are absolutely right, it was one of those functions that didn't follow the directions! Thanks for catching the error. Made one minor change to the comment:

+ // For global flags the user parameter is ignored.

Changed to:

+ // For global flags the user parameter is ignored, so we add the
// extra 'uid' condition when the flag is NOT global.

Will commit this asap. Thanks.

shabana.navas’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thanks. Another similar issue popped up in-tune with this issue. So, will need to revisit this global flag on all the rules events/conditions/actions.

Status: Fixed » Closed (fixed)

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