Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Besides the option of limiting the flags to the "current user" or "all users", in some views it is needed to get the flag for a given content of a given user.
In my case, I wanted an overview of all contents and wheter a given set of users flagged that content or not. With views_cross_join and an additional "By"-Option (that let's you select a specific user relation of the view), I could make this work.
I'll attach the patch in the next comment (to have the issue number for reference).
Comment | File | Size | Author |
---|---|---|---|
#2 | views_relationship_for_content_flag-1451714-2.patch | 3.57 KB | derhasi |
#1 | views_relationship_for_content_flag-1451714-1.patch | 3.53 KB | derhasi |
Comments
Comment #1
derhasi CreditAttribution: derhasi commentedAnd there is the patch, that sureley needs some review ;)
Comment #2
derhasi CreditAttribution: derhasi commentedI updated the patch to be more readable. Would be great you could review it!
Comment #3
joachim CreditAttribution: joachim commentedI'm a bit confused by what this does and when it's needed.
Couldn't this be done with a content view + relationship to flag + relationship to user + filter on user ID?
In fact, now we have the uid field on the flag_content table available, you don't even need the last relationship.
Comment #4
joachim CreditAttribution: joachim commentedClosing old bugs where no further information was supplied.