- π¬π§United Kingdom alexpott πͺπΊπ
We need to add the sort to the schema - there's also another issue with how permissions are revoked which can cause numeric keys to be added unexpectedly.
- Status changed to Needs review
almost 2 years ago 12:28pm 8 February 2023 - π¬π§United Kingdom alexpott πͺπΊπ
Here's a fix using schema to sort the permissions key. This actually will also fix the problems caused by revoking a role and storing numeric keys because the sort will remove the keys.
- π¬π§United Kingdom alexpott πͺπΊπ
Here's a post update function to ensure existing roles are fixed. We also did this in Drupal 8 - see #2409129: Enforce order of permissions in config export β - but we have new abilities with schema to ensure this is the case.
- π¬π§United Kingdom alexpott πͺπΊπ
We should add a test around the revoke permission case that's detailed in the issue summary.
The last submitted patch, 12: 3039499-12.patch, failed testing. View results β
The last submitted patch, 13: 3039499-13.patch, failed testing. View results β
- Status changed to Needs work
almost 2 years ago 12:51pm 15 February 2023 - π¬π§United Kingdom alexpott πͺπΊπ
A duplicate was created of this - π user_update_10000 causes exported permissions to be numerically keyed Closed: duplicate - and this is now critical because it is causing unnecessary config change during an update.
- Status changed to Needs review
almost 2 years ago 1:04pm 15 February 2023 - π¬π§United Kingdom alexpott πͺπΊπ
Fixing the update function and providing 9.5.x and 10.x patches...
- π¬π§United Kingdom alexpott πͺπΊπ
Here's a test that proves we've fixed what the issue summary outlines. I'm not sure that an explicit update test is necessary because the logic if only triggering a re-save of the role and we have implicit testing in all the existing update tests (as you can see from the fails in #13).
The test-only patch is the interdiff.
- π¬π§United Kingdom catch
Adding credit from the duplicate. Looks RTBC assuming the test only patch fails.
Agreed the update function itself doesn't need explicit test coverage given it's not doing much.
- π¬π§United Kingdom alexpott πͺπΊπ
Adding a note to explain why this fixes π user_update_10000 causes exported permissions to be numerically keyed Closed: duplicate . Currently in HEAD sorting occurs on the entity level - in
Role::preSave()
. This patch moves it to the config schema level. Therefore permissions are sorted regardless of whether you interact with the Role configuration entity or with the underlying raw configuration.user_update_10000
is changing the raw configuration so in HEAD was bypassing the sorting but once this is moved to schema it no longer chan. The last submitted patch, 19: 3039499-9.5.x-19.patch, failed testing. View results β
The last submitted patch, 20: 3039499-20.test-only.patch, failed testing. View results β
- Status changed to RTBC
almost 2 years ago 3:46pm 15 February 2023 - π¬π§United Kingdom catch
Test failure looks good, moving to RTBC.
-
larowlan β
committed 90d534fc on 10.0.x
Issue #3039499 by alexpott, acbramley: Role permissions not sorted in...
-
larowlan β
committed 90d534fc on 10.0.x
-
larowlan β
committed 6b5efdc1 on 10.1.x
Issue #3039499 by alexpott, acbramley: Role permissions not sorted in...
-
larowlan β
committed 6b5efdc1 on 10.1.x
-
larowlan β
committed 255b4529 on 9.5.x
Issue #3039499 by alexpott, acbramley: Role permissions not sorted in...
-
larowlan β
committed 255b4529 on 9.5.x
- Status changed to Fixed
almost 2 years ago 12:54am 20 February 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed to 10.1.x and backported to 10.0.x
Committed the 9.5.x patch to 9.5.x
Was going to ask about update path tests, but saw catch was ok with it as is, so didn't flag it.