I've spotted this while working on something else. Filing this for further investigation later.

flag_get_user_flags() has these conditions for getting all the flagging data for an entity:

       ->condition('entity_type', $entity_type)
        ->condition('entity_id', $entity_id)
        ->condition(db_or()
          ->condition('uid', $uid)
          ->condition('uid', 0)
        )
        ->condition('sid', $sid)

So it allows for global flags, where the uid is 0. If you happen to be anonymous, then the two conditions in the 'or' are identical, and that's fine too.
But if you're an anonymous user, you have a non-zero sid. Meanwhile, any global flag records a 0 for both the uid and the sid.
So if there is also a global flag on the entity, and you're anonymous, it won't show up.

Comments

joachim’s picture