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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a.milkovsky created an issue. See original summary.

a.milkovsky’s picture

Status: Active » Needs review
FileSize
2.42 KB

Added a new option for flag relationship 'User from URL'.

Status: Needs review » Needs work

The last submitted patch, 2: flag-uid_from_url-2793529-2.patch, failed testing.

a.milkovsky’s picture

Version: 7.x-3.8 » 7.x-2.x-dev
Status: Needs work » Needs review

fixed version

apmsooner’s picture

I 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.

Status: Needs review » Needs work

The last submitted patch, 5: flag-uid_from_url-2793529-5.patch, failed testing.

apmsooner’s picture

Status: Needs work » Needs review
FileSize
2.39 KB
apmsooner’s picture

FileSize
2.39 KB
apmsooner’s picture

Version: 7.x-2.x-dev » 7.x-3.8

Changing 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.

a.milkovsky’s picture

Assigned: a.milkovsky » Unassigned
Status: Needs review » Reviewed & tested by the community

thank you for the review. making it RTBC. let's see if others will like the feature

apmsooner’s picture

Version: 7.x-3.8 » 7.x-3.9

@a.milkovsky, thanks for the idea! I realized I set the wrong version originally as the patch was tested on 7.x-3.9.

muaz91’s picture

+1 RTBC. Thank you