Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now, when adding the "User: Roles" field to a view, the field will display each of the associated user's roles. The attached patch adds checkbox selectors to the configuration form that allow the user to only show the checked role or roles.
Comment | File | Size | Author |
---|---|---|---|
#10 | views-n1905056-10.patch | 2.1 KB | DamienMcKenna |
| |||
#10 | views-n1905056-10.interdiff.txt | 793 bytes | DamienMcKenna |
Comments
Comment #1
Les LimWhoops. Patch attached.
Comment #2
Les LimCompanion issue for 8.x: #1905062: Whitelist/blacklist roles exposed in roles field handler
Comment #3
amangoel CreditAttribution: amangoel commentedpatch successfully working
Comment #4
Chris Matthews CreditAttribution: Chris Matthews commentedThe 6 year old patch to views_handler_field_user_roles does not apply to the latest views 7.x-3.x-dev.
Comment #5
Andrew Answer CreditAttribution: Andrew Answer as a volunteer commentedPatch rerolled.
Comment #6
Andrew Answer CreditAttribution: Andrew Answer as a volunteer commentedPatch rerolled/fixed after last commits.
Comment #7
muaz91Hi, I tried out the patch from #6. I can say the patch is working. It would be great to implement it on D8 too.
Comment #8
rodmarasi CreditAttribution: rodmarasi commentedComment #9
DamienMcKennaTo add this functionality to D8 you need to create a new issue describing the change and list this one as a "related issue".
Comment #10
DamienMcKennaA slight wording change.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedI would vote for including this feature. I was about to raise an issue myself asking for it, or equivalent capability.
Tony
Comment #13
DamienMcKennaCommitted. Thank you.
Comment #15
muaz91