The chosen default value of the role_id is not pre-selected in the field form

Created on 25 May 2023, over 1 year ago
Updated 30 May 2023, over 1 year ago

Problem/Motivation

When select the roles that should be allowed / denied access, the default value of the role_id is not displayed.
The value is correctly stored and used, but is not showed in edit mode.

Steps to reproduce

  1. Edit the entity with Entity Access by Role field
  2. Select a role that should be allowed / denied access
  3. Save the entity
  4. Edit the entity

Proposed resolution

If add to DefaultEntityAccessRoleWidget.php the code

$element['#type'] = 'checkboxes';

the problem is resolved, but the entity cannot be saved.
The message is: this field cannot hold more than 1 values.

I think: the functionality is designed for many roles, but only one role can be used.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇹Italy marco.aresu Cagliari

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024