Drupal\group\Plugin\GroupContentEnablerBase::createAccess() must implement interface Drupal\group\Entity\GroupInterface, null give

Created on 4 January 2020, over 4 years ago
Updated 20 May 2024, about 1 month ago

For my setup I use https://www.drupal.org/project/forms_steps โ†’ module in combination with group module.

My structure looks like this:
* main group
** subgroup
*** content type 1
*** content type 1

Because the content types are a bit bigger and belong to the subgroup of the content types I wanted to use the "Forms_steps" module. A new workflow was created, but it breaks directly when I call my custom-url.

This is the error message, unfortunately I can not follow what I have to do now.

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\group\Plugin\GroupContentEnablerBase::createAccess() must implement interface Drupal\group\Entity\GroupInterface, null given, called in /var/www/html/docroot/modules/contrib/group/src/Entity/Access/GroupContentAccessControlHandler.php on line 30 in Drupal\group\Plugin\GroupContentEnablerBase->createAccess() (line 375 of modules/contrib/group/src/Plugin/GroupContentEnablerBase.php).
Drupal\group\Plugin\GroupContentEnablerBase->createAccess(NULL, Object) (Line: 30)
Drupal\group\Entity\Access\GroupContentAccessControlHandler->checkCreateAccess(Object, Array, 'group_content_type_cedab2a3275b2') (Line: 260)
Drupal\Core\Entity\EntityAccessControlHandler->createAccess('group_content_type_cedab2a3275b2', Object, Array, ) (Line: 705)
Drupal\Core\Entity\ContentEntityBase->access('create') (Line: 151)
Drupal\forms_steps\Controller\FormsStepsController::getForm('my_group', Object, '') (Line: 40)
Drupal\forms_steps\Controller\FormsStepsController->step('my_group', 'step_1_add_my_group', '')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 694)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

---

I think this is the same problem as here: https://www.drupal.org/project/group/issues/2872645#comment-12734916 ๐Ÿ› Creating `Group` content is impossible via REST, JSON:API and GraphQL due to `$context['group']` being required in checking `create` access Needs work

If I change the line from the comment in the EntityBase.php, the error no longer occurs. But I always get the following error message:

Site's cache must be cleared after adding new form mode:my_group on group_content

However, the cache has been emptied, also drupal update:entities unfortunately does not bring success.

๐Ÿ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany zcht

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024