I have a flag set up for users to report abusive content. I am trying to setup a view that displays all reported content, and then the username of the user who reported the content. Within this view, I have a relationship to the Flag, and a relationship of "Flags:User".

I then have a field "User:Name" that uses the relationship of "Flags:User". If I'm not mistaken, this field should display the user name of the user who reported/flagged the content. However, no matter which user flags the content, this field always shows up as "Anonymous (not verified)". I thought it might have been because the users hadn't verified their account, or that anonymous users were able to flag content, but neither of these is accurate. Any ideas as to why this would be happening?

Comments

joachim’s picture

> and a relationship of "Flags:User".

Not sure that's the right relationship.
Check what join it's providing. If all else fails, check the code.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Is it a global flag?

If so, I suspect the uid is 0 by design.

Nope, that's wrong.

mrweiner’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I assumed that "Flags:User" was the right relationship since its description is "The user that flagged an item." Not sure what else that would mean. :)

But, it turns out that it was set as "Global." Didn't realize that that was a setting until you pointed it out. Turned off Global, and it works as it should.

joachim’s picture

The global possibly ought to work -- at least reading the code and the DB.

joachim’s picture

Ah no, I was wrong. Global flags get a uid of 0 by design.

If you want to know who actually performed a global flagging, you'd need to write a custom module that reacts to flagging and stores the uid.

mrweiner’s picture

Thanks for the tip. Luckily enough, though, it turns out that I didn't even want global functionality anyway. However, now I know what to do if I do end up needing it. :)