Group content delete ECA Call to a member function label() on null

Created on 3 April 2023, about 1 year ago
Updated 4 April 2023, about 1 year ago

Problem/Motivation

Hi,

When deleting a group content, and when a ECA model exists (which triggers a role removal of the current user and role add) when the group content entity is being deleted, I get this error message:

Error: Call to a member function label() on null in Drupal\group\Plugin\GroupContentEnablerBase->getContentLabel() (line 163 of /var/www/html/site/web/modules/contrib/group/src/Plugin/GroupContentEnablerBase.php

Group version: 1.5
Php 8.1
Drupal 9.5.7

EDIT: when I change in the ECA model to delete a content entity (instead of a group content entity) the model works and no errors come.

here is the full error:

/var/www/html/site_test/web/modules/contrib/group/src/Entity/GroupContent.php(132): Drupal\group\Plugin\GroupContentEnablerBase->getContentLabel()
#1 /var/www/html/site_test/web/modules/contrib/eca/src/ConfigurableLoggerChannel.php(236): Drupal\group\Entity\GroupContent->label()
#2 /var/www/html/site_test/web/modules/contrib/eca/src/ConfigurableLoggerChannel.php(165): Drupal\eca\ConfigurableLoggerChannel->getTokenInfo()
#3 /var/www/html/site_test/vendor/psr/log/Psr/Log/LoggerTrait.php(127): Drupal\eca\ConfigurableLoggerChannel->log()
#4 /var/www/html/site_test/web/modules/contrib/eca/src/Entity/Eca.php(627): Drupal\Core\Logger\LoggerChannel->debug()
#5 /var/www/html/site_test/web/modules/contrib/eca/src/Processor.php(180): Drupal\eca\Entity\Eca->getSuccessors()
#6 /var/www/html/site_test/web/modules/contrib/eca/src/Processor.php(146): Drupal\eca\Processor->executeSuccessors()
#7 /var/www/html/site_test/web/modules/contrib/eca/src/EventSubscriber/EcaBase.php(76): Drupal\eca\Processor->execute()
#8 [internal function]: Drupal\eca\EventSubscriber\EcaBase->onEvent()
#9 /var/www/html/site_test/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#10 /var/www/html/site_test/web/modules/contrib/eca/src/Event/TriggerEvent.php(73): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#11 /var/www/html/site_test/web/modules/contrib/eca/modules/content/src/HookHandler.php(87): Drupal\eca\Event\TriggerEvent->dispatchFromPlugin()
#12 /var/www/html/site_test/web/modules/contrib/eca/modules/content/eca_content.module(132): Drupal\eca_content\HookHandler->delete()
#13 [internal function]: eca_content_entity_delete()
#14 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
#15 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#16 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#17 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll()
#18 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#19 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(496): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#20 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(751): Drupal\Core\Entity\EntityStorageBase->delete()
#21 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityBase.php(347): Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete()
#22 /var/www/html/site_test/web/modules/contrib/group/group.module(366): Drupal\Core\Entity\EntityBase->delete()
#23 [internal function]: group_entity_delete()
#24 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
#25 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#26 /var/www/html/site_test/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#27 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll()
#28 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(903): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#29 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(496): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#30 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(751): Drupal\Core\Entity\EntityStorageBase->delete()
#31 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/EntityBase.php(347): Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete()
#32 /var/www/html/site_test/web/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php(71): Drupal\Core\Entity\EntityBase->delete()
#33 [internal function]: Drupal\Core\Entity\ContentEntityDeleteForm->submitForm()
#34 /var/www/html/site_test/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#35 /var/www/html/site_test/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#36 /var/www/html/site_test/web/core/lib/Drupal/Core/Form/FormBuilder.php(595): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#37 /var/www/html/site_test/web/core/lib/Drupal/Core/Form/FormBuilder.php(323): Drupal\Core\Form\FormBuilder->processForm()
#38 /var/www/html/site_test/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#39 /var/www/html/site_test/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult()
#40 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
#41 /var/www/html/site_test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#42 /var/www/html/site_test/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#43 /var/www/html/site_test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#44 /var/www/html/site_test/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#45 /var/www/html/site_test/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#46 /var/www/html/site_test/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#47 /var/www/html/site_test/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#48 /var/www/html/site_test/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#49 /var/www/html/site_test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#50 /var/www/html/site_test/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#51 /var/www/html/site_test/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#52 /var/www/html/site_test/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#53 /var/www/html/site_test/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#54 /var/www/html/site_test/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#55 /var/www/html/site_test/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#56 /var/www/html/site_test/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#57 {main}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.1

Component

Code

Created by

🇫🇮Finland Anaconda777

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

Comments & Activities

Production build 0.69.0 2024