TypeError: groupmedia_group_insert(): Argument #1 ($group) must be of type GroupInterface, Drupal\group\Entity\Group given in groupmedia_group_insert() (line 174 of /var/www/html/drupal/web/modules/contrib/groupmedia/groupmedia.module)

Created on 6 September 2023, 10 months ago
Updated 7 September 2023, 10 months ago

Problem/Motivation

When creating a group, you get a white screen, with the following in log:

TypeError: groupmedia_group_insert(): Argument #1 ($group) must be of type GroupInterface, Drupal\group\Entity\Group given in groupmedia_group_insert() (line 174 of /var/www/html/drupal/web/modules/contrib/groupmedia/groupmedia.module)

#0 [internal function]: groupmedia_group_insert(Object(Drupal\group\Entity\Group))
#1 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#2 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'groupmedia')
#3 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('group_insert', Object(Closure))
#4 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(249): Drupal\Core\Extension\ModuleHandler->invokeAll('group_insert', Array)
#5 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(900): Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object(Drupal\group\Entity\Group))
#6 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(598): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object(Drupal\group\Entity\Group))
#7 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(781): Drupal\Core\Entity\EntityStorageBase->doPostSave(Object(Drupal\group\Entity\Group), false)
#8 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(523): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object(Drupal\group\Entity\Group), false)
#9 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\group\Entity\Group))
#10 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\group\Entity\Group))
#11 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityForm.php(285): Drupal\Core\Entity\EntityBase->save()
#12 /var/www/html/drupal/web/modules/contrib/group/src/Entity/Form/GroupForm.php(85): Drupal\Core\Entity\EntityForm->save(Array, Object(Drupal\Core\Form\FormState))
#13 [internal function]: Drupal\group\Entity\Form\GroupForm->save(Array, Object(Drupal\Core\Form\FormState))
#14 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#15 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#16 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#17 /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('group_test_add_...', Array, Object(Drupal\Core\Form\FormState))
#18 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\group\Entity\Form\GroupForm), Object(Drupal\Core\Form\FormState))
#19 /var/www/html/drupal/web/modules/contrib/group/src/Entity/Controller/GroupController.php(128): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\group\Entity\Group), 'add', Array)
#20 [internal function]: Drupal\group\Entity\Controller\GroupController->addForm(Object(Drupal\group\Entity\GroupType))
#21 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#22 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#24 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#25 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#27 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/drupal/web/modules/contrib/islandora_repository_reports/modules/islandora_repository_reports_oai_usage/src/OaiUsageTrackerMiddleware.php(60): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\islandora_repository_reports_oai_usage\OaiUsageTrackerMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#37 {main}

Steps to reproduce

Logged in as user 1, admin.

Group 2.2.0
Group media 3.0.0
Group permissions 2.0.0-alpha5

1. Create Group type at admin/group/types/add
2. Create Group at group/add
3. Use a Group type, i.e. test at group/add/test
4. Give it a name, and hit Create test and become member
5. White screen: The website encountered an unexpected error. Please try again later.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇨🇦Canada nruest

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

Comments & Activities

Production build 0.69.0 2024