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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Les Lim’s picture

Status: Active » Needs review
FileSize
2.31 KB

Whoops. Patch attached.

Les Lim’s picture

amangoel’s picture

Issue summary: View changes

patch successfully working

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch to views_handler_field_user_roles does not apply to the latest views 7.x-3.x-dev.

Checking patch modules/user/views_handler_field_user_roles.inc...
error: while searching for:
    $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid');
  }

  function query() {
    $this->add_additional_fields();
    $this->field_alias = $this->aliases['uid'];

error: patch failed: modules/user/views_handler_field_user_roles.inc:16
error: modules/user/views_handler_field_user_roles.inc: patch does not apply
Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.23 KB

Patch rerolled.

Andrew Answer’s picture

Patch rerolled/fixed after last commits.

muaz91’s picture

Status: Needs review » Reviewed & tested by the community

Hi, I tried out the patch from #6. I can say the patch is working. It would be great to implement it on D8 too.

rodmarasi’s picture

Issue tags: +VDC
DamienMcKenna’s picture

Issue tags: -VDC

To add this functionality to D8 you need to create a new issue describing the change and list this one as a "related issue".

DamienMcKenna’s picture

A slight wording change.

Anonymous’s picture

I would vote for including this feature. I was about to raise an issue myself asking for it, or equivalent capability.
Tony

  • DamienMcKenna committed 2c91f24 on 7.x-3.x authored by Les Lim
    Issue #1905056 by Andrew Answer, DamienMcKenna, Les Lim, amangoel, Chris...
DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

muaz91’s picture