Problem/Motivation

When creating a new Group with a group joining method of a Group Type (with "creator needs to complete membership").

Result:
The site crashed and the logs returned this:

Referrer	http://groups.test:8083/group/add/full_felxible_group

TypeError: Argument 2 passed to Drupal\group_flex\GroupFlexGroupSaver::saveGroupJoiningMethods() must be of the type array, string given, called in /www/group/modules/group_flex/group_flex.module on line 115 in Drupal\group_flex\GroupFlexGroupSaver->saveGroupJoiningMethods() (line 136 of /www/group/modules/group_flex/src/GroupFlexGroupSaver.php)
#0 /www/group/modules/group_flex/group_flex.module(115): Drupal\group_flex\GroupFlexGroupSaver->saveGroupJoiningMethods(Object(Drupal\group\Entity\Group), 'join_button')
#1 [internal function]: _group_flex_form_group_step2_form_submit(Array, Object(Drupal\Core\Form\FormState))
#2 /www/group/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array('_group_flex_for...', Array)
#3 /www/group/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#4 /www/group/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#5 /www/group/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('group_content_g...', Array, Object(Drupal\Core\Form\FormState))
#6 /www/group/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(61): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\group\Entity\Form\GroupContentForm), Object(Drupal\Core\Form\FormState))
#7 /www/group/modules/group/src/Entity/Controller/GroupController.php(124): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\group\Entity\GroupContent), 'add', Array)
#8 [internal function]: Drupal\group\Entity\Controller\GroupController->addForm(Object(Drupal\group\Entity\GroupType))
#9 /www/group/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /www/group/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /www/group/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /www/group/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /www/group/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /www/group/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /www/group/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /www/group/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /www/group/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /www/group/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /www/group/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /www/group/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /www/group/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /www/group/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /www/group/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}

Steps to reproduce

Create a group type with the following config:

  1. The group creator automatically becomes member checked
  2. Group creator must complete their membership checked
  3. Enable Group flex
  4. Group type visibility: "Let owner decide"
  5. Group joining methods:"Call to action (join button)" checked
  6. Group owner can select the method of her/his "Group"?" checked
  7. Create an instance of this group
  8. Complete the creation and the membership by clicking on the button "Save group and membership"

Proposed resolution

Fix this submit handler to pass array instead of string :-)

Issue fork group_flex-3198908

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jaapjan created an issue. See original summary.

  • jaapjan committed e8d37d6 on 1.x
    Issue #3198908 by jaapjan: "Group owner can select the method of her/his...
jaapjan’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.