Only save a role if permissions have changed

Created on 28 March 2024, 3 months ago
Updated 22 April 2024, 2 months ago

Problem/Motivation

If custom permissions are enabled for a field, then on submit of the field config edit form every user role is updated regardless of any changes to the permissions. This triggers events on the role config entity that should not occur.

Steps to reproduce

Install field_permissions.
Edit a field, enable custom permissions, and save the field.
Edit the same field and save it without making any changes.

NOTE: In order to see the roles being updated use your preferred method to trace the running code, OR output messages to the page each time a role is updated.

Proposed resolution

Only save a role if permissions have changed.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States solotandem

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024