Whenever a webform is opened a PHP warning is generated:

Warning: Invalid argument supplied for foreach() in Drupal\webform\WebformSubmissionForm->getWebformSetting() (line 1569 of /var/www/docroot/modules/contrib/webform/src/WebformSubmissionForm.php) #0 /var/www/docroot/core/includes/bootstrap.inc(548): _drupal_error_handler_real(2, 'Invalid argumen...', '/var/www/docroo...', 1569, Array) #1 /var/www/docroot/modules/contrib/webform/src/WebformSubmissionForm.php(1569): _drupal_error_handler(2, 'Invalid argumen...', '/var/www/docroo...', 1569, Array) #2 /var/www/docroot/modules/contrib/webform/src/WebformSubmissionForm.php(522): Drupal\webform\WebformSubmissionForm->getWebformSetting('form_previous_s...', false) #3 /var/www/docroot/modules/contrib/webform/src/WebformSubmissionForm.php(216): Drupal\webform\WebformSubmissionForm->displayMessages(Array, Object(Drupal\Core\Form\FormState)) #4 [internal function]: Drupal\webform\WebformSubmissionForm->buildForm(Array, Object(Drupal\Core\Form\FormState)) #5 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array) #6 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(271): Drupal\Core\Form\FormBuilder->retrieveForm('webform_submiss...', Object(Drupal\Core\Form\FormState)) #7 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\webform\WebformSubmissionForm), Object(Drupal\Core\Form\FormState)) #8 /var/www/docroot/modules/contrib/webform/src/Entity/Webform.php(808): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\webform\Entity\WebformSubmission), 'default') #9 /var/www/docroot/modules/contrib/webform/src/Controller/WebformController.php(82): Drupal\webform\Entity\Webform->getSubmissionForm() #10 [internal function]: Drupal\webform\Controller\WebformController->addForm(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\webform\Entity\Webform)) #11 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #12 /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #13 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #14 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #15 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #16 /var/www/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) #17 /var/www/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #18 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /var/www/docroot/modules/contrib/shield/src/ShieldMiddleware.php(68): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /var/www/docroot/core/lib/Drupal/Core/DrupalKernel.php(652): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /var/www/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #26 {main}.

Other than the warning webforms seems to work without any problem.
Problem is reproducible on D8.2.7 for any new or previously created webform.

CommentFileSizeAuthor
#2 Invalid-argumnet-warning-2868592-1.patch939 bytesp-andrei
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

p-andrei created an issue. See original summary.

p-andrei’s picture

Here is a patch with a simple verification to avoid the warning.

jrockowitz’s picture

@p-andrei It looks like your site is missing the webform.setting.yml.

Please go to /admin/structure/webform/settings and click 'Save'.

or execute `drush webform-repair`.

p-andrei’s picture

@jrockowitz you are right, drush webform-repair helped.

Thank you!

p-andrei’s picture

Status: Active » Closed (works as designed)
auxiliaryjoel’s picture

Thank you so much @jrockowitz this fixed the issue (#3 in this thread)!

pyxio’s picture

drush webform-repair does not work for me. i get this error.

Are you sure you want repair the Webform module's admin settings and webforms? (y/n): y
Repairing webform submission storage schema…
TypeError: Argument 1 passed to Drupal\Core\Entity\EntityDefinitionUpdateManager::updateEntityType() must [error]
be an instance of Drupal\Core\Entity\EntityTypeInterface, null given, called in
/var/www/html/energi/modules/contrib/webform/includes/webform.install.inc on line 285 in
Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType() (line 163 of
/var/www/html/energi/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php) #0
/var/www/html/energi/modules/contrib/webform/includes/webform.install.inc(285):
Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType(NULL)
#1 /var/www/html/energi/modules/contrib/webform/src/Commands/WebformCliService.php(753):
_webform_update_webform_submission_storage_schema()
#2 /var/www/html/energi/modules/contrib/webform/drush/webform.drush.inc(372):
Drupal\webform\Commands\WebformCliService->drush_webform_repair()
#3 phar:///usr/local/bin/drush/includes/command.inc(371): drush_webform_repair()
#4 phar:///usr/local/bin/drush/includes/command.inc(222): _drush_invoke_hooks(Array, Array)
#5 phar:///usr/local/bin/drush/includes/command.inc(190): drush_command()
#6 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#9 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#10 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#11 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#12 {main}.
TypeError: Argument 1 passed to Drupal\Core\Entity\EntityDefinitionUpdateManager::updateEntityType() must be an instance of Drupal\Core\Entity\EntityTypeInterface, null given, called in /var/www/html/energi/modules/contrib/webform/includes/webform.install.inc on line 285 in /var/www/html/energi/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php on line 163 #0 /var/www/html/energi/modules/contrib/webform/includes/webform.install.inc(285): Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType(NULL)
#1 /var/www/html/energi/modules/contrib/webform/src/Commands/WebformCliService.php(753): _webform_update_webform_submission_storage_schema()
#2 /var/www/html/energi/modules/contrib/webform/drush/webform.drush.inc(372): Drupal\webform\Commands\WebformCliService->drush_webform_repair()
#3 phar:///usr/local/bin/drush/includes/command.inc(371): drush_webform_repair()
#4 phar:///usr/local/bin/drush/includes/command.inc(222): _drush_invoke_hooks(Array, Array)
#5 phar:///usr/local/bin/drush/includes/command.inc(190): drush_command()
#6 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#9 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#10 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#11 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#12 {main}
TypeError: Argument 1 passed to Drupal\Core\Entity\EntityDefinitionUpdateManager::updateEntityType() must be an instance of Drupal\Core\Entity\EntityTypeInterface, null given, called in /var/www/html/energi/modules/contrib/webform/includes/webform.install.inc on line 285 in Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType() (line 163 of /var/www/html/energi/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php).
Drush command terminated abnormally due to an unrecoverable error.

pyxio’s picture

i solved this by running drush entup first and then drush wfr and it worked