Problem/Motivation
Currently the google_tag.settings change when a new role is inserted even though the module's configuration has not changed. This is due to the configuration saving all available roles, rather than only the configured roles.
Proposed resolution
Only save the configured roles in google_tag.settings.role_list, so the module's configuration is unchanged when a new user role is added.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
google_tag.settings.role_list now only saves configured roles.
Release notes snippet
google_tag.settings.role_list now only saves configured roles.
Comments
Comment #2
idebr commentedAttached patch only saves the configured roles in google_tag.settings.role_list, so the module's configuration is unchanged when a new user role is added.
Before:
After:
Comment #4
solotandem commentedGood suggestion.
The patch omits hook_update_N as:
- the [exported] config will change one time regardless
- so that doing so in update hook is not necessary
- the filter of values is not mission critical to the other code
The patch retains array_filter() in _google_tag_role_check() to retain the array keys.
If you disagree with the changes please comment.