- Issue created by @alexpott
- π¬π§United Kingdom alexpott πͺπΊπ
Creditting @poker10 for the steps to reproduce from #3358586-69: RuntimeException: Adding non-existent permissions to a role is not allowed β
- Merge request !10844Fix permissions when content translation status changes β (Open) created by alexpott
- π¨πSwitzerland berdir Switzerland
I also commented in π ContentTranslationManager::isEnabled() can load/create the same config entity many times Active about this.
The dependency stuff is interesting. Do we have any other use case where the dependency is based on a certain *value* of another config entity as opposed to its existence.
As mentioned over there, combined with the hook, it results in two parallel cleanup processes of role permissions.
A couple suggestions on the MR for missing NULL/empty checks, one of which is causing the majority of test failures.
The update hook is also loading role entities without checking that the role entity type exists, but it's only an issue if the user module isn't installed, which seems like a very unusual edge case.
Rebased and updated the MR:
- Applied my suggestions for the null checks
- Removed bundle dependencies when entity permission granularity is at the entity type level
- The line
$this->assertEquals(['entity_test.entity_test_mul_bundle.test'], $permissions['translate test entity_test_mul_with_bundle']['dependencies']['config']);
when testing bundle granularity with bundle that is not config seems to be testing the wrong thing, so that has been replaced with$this->assertEquals(['language.content_settings.entity_test_mul.entity_test_mul'], $permissions['translate entity_test_mul entity_test_mul']['dependencies']['config']);
- Added test to confirm that when bundle translation is disabled, the permission is removed from the role