I want to create a list with nodes, where administrator can see which nodes are flagged/not flagged by a user.
What I do:
Create a views page with nodes.
Display as Table.
Set views path to user/%/flags.
Add relationship to 'Flags': Uncheck 'Include only flagged content', Choose target flag, Check 'Any user'.
Add field 'Content: Title'.
Add filter criteria 'Flags: Flagged': Expose this filter to visitors.
Add contextual filter 'Flag: uid': Default argument "User ID from URL'.
What I get:
When 'Flagged' filter is set to 'True', I see all the nodes flagged by user.
When 'Flagged' filter is set to 'False', I see no results.
Expected: I would like to see all the nodes, that are not flagged by the user.
Conclusions: of course I will not see unflagged fields of the user, because contextual filter makes user ID required field.
Possible solution: add user ID to relationship's JOIN conditions.
Comment | File | Size | Author |
---|---|---|---|
#8 | flag-uid_from_url-2793529-6.patch | 2.39 KB | apmsooner |
|
Comments
Comment #2
a.milkovskyAdded a new option for flag relationship 'User from URL'.
Comment #4
a.milkovskyfixed version
Comment #5
apmsooner CreditAttribution: apmsooner commentedI need this functionality too and the code works great. The path to the file was wrong in the original patch so hopefully this one gets a pass.
Comment #7
apmsooner CreditAttribution: apmsooner commentedComment #8
apmsooner CreditAttribution: apmsooner commentedComment #9
apmsooner CreditAttribution: apmsooner commentedChanging version to most recent version. Code works great for me. Example of what feature provides for me is a list of course nodes by user flagged/unflagged for administrators to evaluate what courses they passed and whats remaining.
Comment #10
a.milkovskythank you for the review. making it RTBC. let's see if others will like the feature
Comment #11
apmsooner CreditAttribution: apmsooner commented@a.milkovsky, thanks for the idea! I realized I set the wrong version originally as the patch was tested on 7.x-3.9.
Comment #12
muaz91+1 RTBC. Thank you