Unable to delete groups with permissions

Created on 14 February 2023, almost 2 years ago

I have a project with the "group" and "group_permissions" modules installed, and some groups have been inserted. When I try to delete one of the groups, the following error happens:

Drupal\Core\Entity\EntityStorageException: Some mandatory parameters are missing ("group") to generate a URL for route "entity.group_permission.canonical". in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 761 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.group_permission.canonical', Object, Array) (Line: 132)
Drupal\Core\Routing\UrlGenerator->getPathFromRoute('entity.group_permission.canonical', Array) (Line: 68)
Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute('entity.group_permission.canonical', Array) (Line: 802)
Drupal\Core\Url->getInternalPath() (Line: 77)
redirect_entity_delete(Object)
call_user_func_array(Object, Array) (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'redirect') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_delete', Object) (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_delete', Array) (Line: 251)
Drupal\Core\Entity\EntityStorageBase->invokeHook('delete', Object) (Line: 903)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('delete', Object) (Line: 496)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 751)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete(Array) (Line: 347)
Drupal\Core\Entity\EntityBase->delete() (Line: 16)
group_permissions_group_delete(Object)
call_user_func_array(Object, Array) (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'group_permissions') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('group_delete', Object) (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll('group_delete', Array) (Line: 249)
Drupal\Core\Entity\EntityStorageBase->invokeHook('delete', Object) (Line: 903)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('delete', Object) (Line: 496)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 751)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete(Array) (Line: 347)
Drupal\Core\Entity\EntityBase->delete() (Line: 71)
Drupal\Core\Entity\ContentEntityDeleteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 595)
Drupal\Core\Form\FormBuilder->processForm('group_business_unit_delete_form', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I figured out some things and one of those things is the problem starts here and the problem occurrs here

Some Debug steps step1 ,
step2

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇷Brazil exsonivo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024