The php notics is:

Notice: Trying to get property of non-object in flag_rules_condition_flagged() (line 399 of C:\wamp\www\job\sites\all\modules\contrib\flag\flag.rules.inc).

Flag Rules expects in a function the argument to be in the second place the entity which in this case is correctly the User entity but also the user account for the third argument which should once again be the user account object but since it's left out the settings array is being passed.

I am attaching screen shots from the debugger so you can see where and what the problem is.

CommentFileSizeAuthor
#2 flag_user_param.patch959 bytesfago
flagbug2.jpg301.89 KBAdam S
flagbug1.jpg94.08 KBAdam S

Comments

quicksketch’s picture

Priority: Major » Normal

Same issue over at #1274162: Notice: Trying to get property of non-object in flag_rules_condition_flagged(). I don't support the Rules integration, hopefully fago will take a look at this when he gets the chance.

fago’s picture

Status: Active » Needs review
StatusFileSize
new959 bytes

uhm, looks like the array keys "user" and "user" clash... Attached patch should fix it. After applying the patch, run update.php and re-configure your condition. Then it should work. Please test.

Unfortunately, the patch requires every user of the condition to re-configure the re-named parameter. :/

blogook’s picture

Do you have the patched file for me ?? i have no clue how to patch this.. :

infines’s picture

Status: Needs review » Reviewed & tested by the community
infines’s picture

Status: Reviewed & tested by the community » Needs work

The patch did the trick however, now I can't figure out how to send an email to people who've flagged a user. After that user has saved new content.

blogook’s picture

Same here .. i was finally able to use the patch and it is working now. .. but i cannot figure out how to send an email notification to the user who flagged another user.

Another aspect that I wonder about is when a user decides to flag a user, and therefor receives notifications when that user post new content.. There is no way to turn that off other than stop 'following' that user. Is it somehow possible to stop receiving notifications?

infines’s picture

@blogook I just added a booleen field to user profile. Then in Rules under conditions, check if flagging user has it checked with Data Comparison.

Otherwise support on how to send an email to the flagging user of a flagged user, would be great!

blogook’s picture

blogook’s picture

Can you pls explain a bit more about that boolean field? :)

infines’s picture

Status: Needs work » Reviewed & tested by the community
infines’s picture

Contact my via my contact page and I'll explain. For now, this needs a commit, stat.

pixelsticks’s picture

I'm getting a failure beginning at line 450 when I apply the patch. I ran update.php anyway, unflagged and reflagged the test account and recreated the rule entirely but no luck. Am I missing a step?

Thanks!

infines’s picture

clear caches?

fago’s picture

Status: Reviewed & tested by the community » Fixed

Yep, after the patch has been applied you need to clear your caches, i.e. run update.php.

Committed.

pixelsticks’s picture

Success -- terminal wasn't doing the trick so I had to manually patch the file. Thanks, guys!

Status: Fixed » Closed (fixed)

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