- Issue created by @waropd
- First commit to issue fork.
- @ydbalaji opened merge request.
- π¦π·Argentina dariogcode
$names = taxonomy_vocabulary_get_names();
isn't needed anymore, we can load all vocabulary with just
$vocabularies = Vocabulary::loadMultiple();
Patch attached.
I already used vppr in drupal 10 with patch.
I had a serious problem:When you delete a vocabulary, drupal doesn't revoke permissions from vppr correctly.
In my case it was very problematic:
- My role webmaster has the permission "administer [vocabulary name] vocabulary terms"
- I deleted vocabulary
- Drupal outputs me:
RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "administer [vocabulary name] vocabulary terms", "view latest version". in Drupal\user\Entity\Role->calculateDependencies() (line 206 of /var/www/html/web/core/modules/user/src/Entity/Role.php).
- The role webmaster was remove because dependency to the vocabularyI rollback but it can be fatal to another developer.
In my case to avoid this, I use a revoke permission in a hook_vocabulary_delete :
$permission = "administer ".$entity->id()." vocabulary terms" $roles = Role::loadMultiple(); foreach ( $roles as $role ){ if( $role->id() === 'administrator'){//not necessary for admin continue; } if( $role->hasPermission($permission)){ $role = $role->revokePermission($permission); $role->save(); } } }
- π©πͺGermany rgpublic DΓΌsseldorf π©πͺ πͺπΊ
@Tichris59: But is this a new problem due to the patch? Or is this a general problem/bug with vppr. In the latter case, this should perhaps be files as a new bug, I guess...?
General problem with vprr, the permission are not correctly uninstalled when a vocabulary is delete, so we will have runtime exception.
- Status changed to RTBC
about 1 year ago 8:47am 11 October 2023 - π³π±Netherlands jaapjan
Let's mark this as RTBC and perhaps create a separate issue for #9?
Patch from #8 is the most straight-forward approach to support D10.
Would be great if a maintainer could take a look at this and create a D10 compatible release accordingly.
- π¬π§United Kingdom robcarr Perthshire, Scotland
Note that the patch at #3336179-8: Drupal 10 compatibility β will only work against the DEV release, not the 8.x-1.2 version
- πΊπΈUnited States todea
Is this module still necessary in Drupal 10? Core seems to provide this functionality where you can allow roles to manage specific vocabularies.