0

I'm creating an approval/review workflow with notifications.
The content type we're reviewing is called a "Scholarship", and the first review is being carried out by an Intern (interns are a role in my permissions schema). The Scholarship type has an entity reference to a user, of type "intern", which an admin can assign.

I need to create a view for each Intern such that she sees a list of the Scholarships that are assigned to her, in other words all Scholarships where the entity reference field "Intern reviewer" is the same as the logged-in user.

I've got a page display that correctly returns the title of each of my Scholarship nodes. I've created an relationship with the entity that's referenced in the ER field, so as to connect with the assigned intern. I then created a Contextual Filter on the "Intern Reviewer" field, set it to provide a default value, and selected the UID of the current user as that value.

Unfortunately this isn't returning any results. Methinks this may have to do with the fact that what's stored in the ER field is the Intern's username, whereas the contextual filter is using the UID of the logged-in user. Perhaps I need to find a way to provide the current logged-in user's login name as the fixed filter value? In any case, if anyone has any ideas I'd be grateful to hear them.

1

The steps to create a view that lists all nodes of type scholarship that are referenced to the current logged in user:

  1. Add new view, showing content of type scholarship
  2. Add a relationship: Entity Reference: Referenced Entity
  3. Add new filter: User: Current
  4. Select Yes for the option Is the logged in user
  5. Save.
0

When you add contextual filter by UID make sure that you select right relationship at the top. Views contextual window

  • Still no joy, sadly. I was using a Contextual filter on the Entity Reference, but I changes it to filter on the UID after I read your post, It's using the relationship "User entity referenced from field_intern_reviewer". When the filter value is not in the URL, it provides default value of "User ID from logged in user". And yet, a logged in user who definitely has one of these things assigned, sees nothing. – Sam Moore Apr 15 '14 at 20:01
  • If you will give me code of your exported views or make a screenshot of your view then I'll try to help. – paravibe Apr 16 '14 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.