Solved

Drupal Roles Reference module not working in Views

Posted on 2010-11-28
7
522 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now