Solved

Drupal Roles Reference module not working in Views

Posted on 2010-11-28
7
540 Views
Last Modified: 2012-05-10
I have a content type downloads that, using the Roles Reference module, contains a field for role that allows the admin to assign a role to the download. The plan is to only show downloads that match the role of the logged in user.

In Views I created a download view that uses the role filter provided by the Roles Reference module. I made sure the appropriate fields were included in the view so that the filter would work. It's simply not working.

I don't have a lot of Drupal experience—I usually provide custom built CMS—so this may be a very easy fix. I'm hoping. My client is getting impatient.
0
Comment
Question by:stephenbliss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:RobertPope
ID: 34232511
are you using this view in a block?  are you using arguments to limit the view?  If so are you certain your arguments are in scope when using the block?
0
 

Author Comment

by:stephenbliss
ID: 34232694
I'm using this view as a page that lists available downloads. The only filters are by node=downlaod and then the Current Roles = Yes provided by the roles reference module. In fields I included Content: Role and User: Roles not being certain which were required for the filter. When I view the page—nothing. If I remove the filter for Current Roles I see all the downloads as expected. So I know it all works, just the Roles filtering that doesn't.
0
 
LVL 3

Expert Comment

by:RobertPope
ID: 34232739
I may have 20 minutes after 5pm to screenshare a bit with you - I am thinking you are going to want to use arguments to solve this though

0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

Author Comment

by:stephenbliss
ID: 34232854
That would be awesome. Just not sure of my schedule 5 - 6. Later would work for sure and anytime tomorrow.
0
 

Accepted Solution

by:
stephenbliss earned 0 total points
ID: 34315630
I solved this by using a User Reference field type in the content type. This works perfectly—we can select the users that we want to have access to these downloads individually providing the granularity the client wanted.
0
 
LVL 3

Expert Comment

by:RobertPope
ID: 34315970
Hey that's great!  nice work.
0
 

Author Closing Comment

by:stephenbliss
ID: 34341733
I was directed to this solution by information I found elsewhere on the web.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Read about how to approach blogging and about ways to do it right. Stand out from the crowd and let your knowledge be consumed by a large audience. This article aims to explain how your blog should look like,  the most important things to do while b…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question