Problem/Motivation
Drupal 9.3 introduced dependencies of roles on the providers of the permissions.
See:
Permissions can define dependencies
Permissions must exist
#2571235: [regression] Roles should depend on objects that are building the granted permissions
Config Role Split does not currently concern itself with that, but this will most likely lead to the config import not working correctly.
Steps to reproduce
Proposed resolution
Split also dependencies information together with the permission id, or maybe it can be inferred at runtime?
Remaining tasks
Maybe this is best done in conjunction with #3223564: Use config storage transformation API
User interface changes
none
API changes
tbd
Data model changes
tbd
Comment | File | Size | Author |
---|---|---|---|
#5 | 3223569-5.patch | 4.86 KB | afsch |
#3 | 3223569-3.patch | 4.35 KB | marcoscano |
|
Issue fork config_role_split-3223569
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
marcoscanoI'm not convinced this is all it needs to "make
config_role_split
work with core 9.3+", but here's a start. With this patch, we make sure the$data['dependencies']
array is always in sync with whatever permissions are left after applying the filter. (I say there may be other things needed since core 9.3+ DB updates seem to mess around more than expected with roles (at least in the project I'm working on), so some level of manual adjustment may be necessary when doing the upgrade itself, and then this patch could (hopefully) make things not break in the long-run).Would appreciate feedback on the approach, since I'm not really not familiar with this system. Thanks!
Comment #4
marcoscanoI was also not sure if the
config_role_split.role_split.*
objects themselves should have dependencies that match the permissions they contain? It seemed a bit redundant to me, but maybe that's the correct way to move this patch forward, not sure.Comment #5
afschUsing with Drupal 9.4.5, re-rolling the patch adding an extra verification of the $data.
I was getting the following error:
Comment #6
pfrenssenI didn't have the chance to review the code, but the patch works on Drupal 9.3.