Problem/Motivation
If the taxonomy_access_fix_update_9401 and taxonomy_access_fix_update_9402 hooks run in the same deploy as the user_update_10000 hook (e.g. during a site update from Drupal 9 to 10), the deploy can fail. This is because the taxonomy_access_fix update hooks change the permissions and save the roles, which causes an error if the role contains non-existent permissions:
Adding non-existent permissions to a role is not allowed.
Proposed resolution
Implement taxonomy_access_fix_update_dependencies to indicate that the taxonomy_access_fix update hooks have to run after the user update hook.
Issue fork taxonomy_access_fix-3376410
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
dieterholvoet commentedComment #4
feyp commentedThanks for filing the issue.
The assumption was that you made the update of the module before upgrading core, a direct upgrade of both at the same time has never been tested.
Looking at the test results, it looks like this is failing, if you do the update in Drupal 9. I guess because then the dependencies are not fulfilled, because there is no such user update hook, yet?
Looks like we need to work on this some more.
Comment #5
feyp commentedFor now, I've added this as a known issue to the release notes. I'd also say this is a major issue.
Comment #6
feyp commentedComment #7
dieterholvoet commentedI added a workaround that should fix this issue. However, the test failure looks like a core bug, so I'll file an issue in that issue queue.
Comment #8
dieterholvoet commentedComment #9
dieterholvoet commentedComment #10
feyp commentedThanks! Test results look good now and the code looks good as well. I didn't realize that the fix would be that easy, I thought we might have to move everything to post update hooks, which might have had other problems, or work on the role config directly or something...
I'd like to give this some manual testing before I commit this, just in case, will do that later. Then I can hopefully also take a look at the MR for core, unless @smustgrave beats me to it ;).
Comment #11
feyp commentedNow had a chance to test the various upgrade paths manually and it seems to work as intended. RTBC.
Comment #13
feyp commentedMerged. Thanks again!