rng
rng copied to clipboard
Saving an event type leads to an error Invalid argument supplied for foreach()
Saving an event type leads to an error:
---- edit ---- This happens, if there is no Person Type (People Type) available. There is no person type available, if in admin/config/rng/settings the People Type User (user) is unchecked. It does not matter, if there is Contact (rng_contact) checked. ---- edit ----
The error message is as follows:
Warning: Invalid argument supplied for foreach() in Drupal\rng\Form\EventTypeForm->save() (line 315 of modules/contrib/rng/src/Form/EventTypeForm.php). Drupal\rng\Form\EventTypeForm->save(Array, Object) call_user_func_array(Array, Array) (Line: 111) Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51) Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 590) Drupal\Core\Form\FormBuilder->processForm('event_type_edit_form', Array, Object) (Line: 319) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 93) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 582) 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: 50) Drupal\ban\BanMiddleware->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: 693) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
This happens on creating a new event, as well as on saving an existing event.