If you create a user flag and try to use "User is flagged" as a condition in a rule an error is thrown:
Notice: Trying to get property of non-object in flag_rules_condition_flagged() (line 399 of /Users/creynder/Dropbox/Work/Research/Drupal/drupal-7.x/sites/all/modules/flag/flag.rules.inc).
And the rule action is not executed.

The error is thrown in the flag_rules_condition_flagged method.
After a little debugging I found out the the 3rd parameter ($account) does not receive a user object, but an array containing 2 keys:
flag and user:select. See att. for dsm dump.
The 2nd parameter $entity however does receive the correct user object.

This rule condition does work as it should with node flags.

#6 1610172-6.patch477 bytesShabana Blackborder
PASSED: [[SimpleTest]]: [MySQL] 254 pass(es).
[ View ]
Screen shot 2012-05-31 at 11.01.14.png26.81 KBcreynders


having the same issue.

Version:7.x-2.0-beta6» 7.x-2.0-beta7

same for me

I changed the line 399
from: return $flag->is_flagged($flag->get_content_id($entity), $account->uid); in return $flag->is_flagged($flag->get_content_id($entity), $account);.
Idon't know if this is the right way, but it works for me.

Any chance you could post that as a patch please?

Version:7.x-2.0-beta7» 7.x-3.x-dev
Issue tags:+needs backport to 7.x-2.x

Upping version; will need backport.

new477 bytes
PASSED: [[SimpleTest]]: [MySQL] 254 pass(es).
[ View ]

Patch against version 7.x-3.x is submitted below.

Status:Active» Fixed

Status:Fixed» Needs review

Thanks for the patch!

Setting to 'needs review' so other users know this needs trying out.

For some reason, I cannot replicate this problem without the patch. Anyone else getting this error still?