Problem/Motivation

- Adding a new role overwrote the previous due to this line $roles = array_map(function($role) { return $role->target_id; }, $this->get('roles'));
- Also threw an error

Steps to reproduce

- Add a new role via the People view actions or programmatically

Proposed resolution

- Fix the use of $this->get('roles')

Comments

kimberleycgm created an issue. See original summary.

kimberleycgm’s picture

Status: Active » Needs review
StatusFileSize
new775 bytes
kimberleycgm’s picture

Updated the patch to use the same basic method the original code was using, just updated to the correct format. Previous patch was resulting in some users getting the 'anonymous' role when adding a role when creating a user using User::create()

kimberleycgm’s picture

kimberleycgm’s picture

StatusFileSize
new1011 bytes

Same for removing a role, patch updated

freelock’s picture

Status: Needs review » Fixed

Thanks for the patch! Committed.

Status: Fixed » Closed (fixed)

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