Solved

Drupal Roles Reference module not working in Views

Posted on 2010-11-28
7
546 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

617 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