TypeError: strlen(): Argument #1 ($string) must be of type string

Created on 19 March 2023, over 1 year ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

I run, Drupal 9.5.5 php 8.1.16 Webform 6.2.0-beta5 Mailchimp 2.2.0 and Webform Mailchimp 8.x-5.9
so far everything worked fine. I think up to Drupal 9.5.3

But now the website crashes with an unexpected error has occurred on the screen.

The Webform submission works normally.

Steps to reproduce

Here is the error log I get. but I have no idea what it means.

TypeError: strlen(): Argument #1 ($string) must be of type string, array given in strlen() (Zeile 320 in /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform_mailchimp/src/Plugin/WebformHandler/WebformMailChimpHandler.php)
#0 [internal function]: strlen(Array)
#1 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform_mailchimp/src/Plugin/WebformHandler/WebformMailChimpHandler.php(320): array_filter(Array, 'strlen')
#2 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/Entity/Webform.php(2758): Drupal\webform_mailchimp\Plugin\WebformHandler\WebformMailChimpHandler->postSave(Object(Drupal\webform\Entity\WebformSubmission), false, NULL)
#3 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionStorage.php(1212): Drupal\webform\Entity\Webform->invokeHandlers('postSave', Object(Drupal\webform\Entity\WebformSubmission), false, NULL)
#4 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionStorage.php(1120): Drupal\webform\WebformSubmissionStorage->invokeWebformHandlers('postSave', Object(Drupal\webform\Entity\WebformSubmission), false)
#5 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Entity/EntityStorageBase.php(523): Drupal\webform\WebformSubmissionStorage->doPostSave(Object(Drupal\webform\Entity\WebformSubmission), false)
#6 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\webform\Entity\WebformSubmission))
#7 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionStorage.php(983): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\webform\Entity\WebformSubmission))
#8 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\webform\WebformSubmissionStorage->save(Object(Drupal\webform\Entity\WebformSubmission))
#9 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/Entity/WebformSubmission.php(901): Drupal\Core\Entity\EntityBase->save()
#10 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionForm.php(1995): Drupal\webform\Entity\WebformSubmission->save()
#11 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionForm.php(1705): Drupal\webform\WebformSubmissionForm->save(Array, Object(Drupal\Core\Form\FormState))
#12 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionForm.php(1666): Drupal\webform\WebformSubmissionForm->wizardSubmit(Array, Object(Drupal\Core\Form\FormState))
#13 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/WebformSubmissionForm.php(1626): Drupal\webform\WebformSubmissionForm->next(Array, Object(Drupal\Core\Form\FormState), true)
#14 [internal function]: Drupal\webform\WebformSubmissionForm->submit(Array, Object(Drupal\Core\Form\FormState))
#15 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#16 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#17 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Form/FormBuilder.php(595): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#18 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Form/FormBuilder.php(323): Drupal\Core\Form\FormBuilder->processForm('webform_submiss...', Array, Object(Drupal\Core\Form\FormState))
#19 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\webform\WebformSubmissionForm), Object(Drupal\Core\Form\FormState))
#20 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/Entity/Webform.php(1250): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\webform\Entity\WebformSubmission), 'add')
#21 /home/XXXXXX/www/test.XXXX.XX/modules/contrib/webform/src/Controller/WebformEntityController.php(77): Drupal\webform\Entity\Webform->getSubmissionForm()
#22 [internal function]: Drupal\webform\Controller\WebformEntityController->addForm(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\webform\Entity\Webform))
#23 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#24 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#26 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#27 /home/XXXXXX/www/test.XXXX.XX/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /home/XXXXXX/www/test.XXXX.XX/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#29 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/XXXXXX/www/test.XXXX.XX/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /home/XXXXXX/www/test.XXXX.XX/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /home/XXXXXX/www/test.XXXX.XX/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /home/XXXXXX/www/test.XXXX.XX/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /home/XXXXXX/www/test.XXXX.XX/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#38 {main}

Who can help here. What more should I send.
Thanks
Lothar

🐛 Bug report
Status

Closed: duplicate

Version

5.9

Component

Code

Created by

🇨🇭Switzerland lomale@bluewin.ch Switzerland

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

Comments & Activities

Production build 0.71.5 2024