After I updated from beta7 to beta9 I get the following message, when I try to load any of my webforms:

Unable to display this webform. Please contact the site administrator

If I try to open a submission result, I get a WSOD, with the following error in php logs:

TypeError: Argument 1 passed to Drupal\\webform\\WebformSubmissionViewBuilder::buildElements() must be of the type array, boolean given, called in /var/customers/webs/freigeist/freigeist-dev/modules/webform/includes/webform.theme.inc on line 310 in /var/customers/webs/freigeist/freigeist-dev/modules/webform/src/WebformSubmissionViewBuilder.php on line 130 #0 /var/customers/webs/freigeist/freigeist-dev/modules/webform/includes/webform.theme.inc(310): Drupal\\webform\\WebformSubmissionViewBuilder->buildElements(false, Array)\n#1 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_webform_submission_html(Array, 'webform_submiss...', Array)\n#2 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\\Core\\Theme\\ThemeManager->render('webform_submiss...', Array)\n#3 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/Renderer.php(448): Drupal\\Core\\Render\\Renderer->doRender(Array)\n#4 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\\Core\\Render\\Renderer->doRender(Array, false)\n#5 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\\Core\\Render\\Renderer->render(Array, false)\n#6 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\\Core\\Render\\MainContent\\HtmlRenderer->Drupal\\Core\\Render\\MainContent\\{closure}()\n#7 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#8 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\\Core\\Render\\MainContent\\HtmlRenderer->prepare(Array, Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\Core\\Routing\\CurrentRouteMatch))\n#9 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\\Core\\Render\\MainContent\\HtmlRenderer->renderResponse(Array, Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\Core\\Routing\\CurrentRouteMatch))\n#10 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\\Core\\EventSubscriber\\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#11 /var/customers/webs/freigeist/freigeist-dev/vendor/symfony/http-kernel/HttpKernel.php(149): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent))\n#12 /var/customers/webs/freigeist/freigeist-dev/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#13 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 /var/customers/webs/freigeist/freigeist-dev/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /var/customers/webs/freigeist/freigeist-dev/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/customers/webs/freigeist/freigeist-dev/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#20 /var/customers/webs/freigeist/freigeist-dev/core/lib/Drupal/Core/DrupalKernel.php(652): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#21 /var/customers/webs/freigeist/freigeist-dev/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#22 {main}, referer: https://www.freigeist-akademie.de/admin/structure/webform/manage/anmeldung/results/submissions

I cleared all caches with drush.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gunwald created an issue. See original summary.

gunwald’s picture

Issue summary: View changes
jrockowitz’s picture

The error indicates that your Webform is not returning any elements.

Are you using configuration translation? What is the site's default language?

Is the default 'Contact' form still working? Do new forms still work?

gunwald’s picture

The default contact form is the only one that works. All other don't, not even new forms. I tried to clear all results of the existing forms, but get still the same error. I tried to delete it's elements one by one, to see, if it has to do with a specific element, but even if there is no element in the form, it does not work.

The site has German, English and Italian installed, where German is the default language. But what do you exactly mean by »configuration translation«? The only translations I have, are the interface translations which are available on the module translations pages.

Thanks for the quick response!

jrockowitz’s picture

Webform's are configuration entities which would be translated using the configuration translation module.

The default Contact form is 'English' and I think all your new forms are in 'German'.

Can you export the forms and look at the their langcodes and elements?

I am wondering if the broken form's langcode is 'en' or 'de'.

gunwald’s picture

FileSize
39.44 KB
43.61 KB

The Configuration Translation module isn't enabled. It turned out, that the default contact form is in German and all other in English (maybe I chose German during the install process, a regrettable decision).

Default form export screenshot

Custom form export screenshot

jrockowitz’s picture

That information helps me a lot.

For now, does enabling the configuration translation module help.

gunwald’s picture

Yes, it works again after I enabled the module. Thanks a lot for the great support!

jrockowitz’s picture

Here are the steps required to duplicate this issue...

  • Setup a default install of Drupal (ie English)
  • Install the Webform module
  • Verify that the Contact form loads (/form/contact)
  • Enable the Language module
  • Add a new Language and set it as the default.
  • Goto Contact form loads (/form/contact)
  • Confirm that the Contact form is broken and displays "Unable to display this webform. Please contact the site administrator."
jrockowitz’s picture

Hopefully this patch solves the problem.

This should resolve the primary issue where a site is using a different language but does not need Webforms translated into multiple languages.

I am doubtful, I can fix sites that enable configuration translation, translate a few webforms, and then disable configuration translation. This scenario is just going to break the webforms.

Status: Needs review » Needs work

The last submitted patch, 10: unable_to_display_this-2858766-10.patch, failed testing.

jrockowitz’s picture

Status: Needs work » Needs review
FileSize
1.23 KB
sokru’s picture

I have the same problem. I had same steps as in #9, but I enabled all Multilingual modules (as suggested in https://www.drupal.org/node/2697553). Tested patch in #12, but did not help. From logs
TypeError: Argument 2 passed to Drupal\webform\Utility\WebformElementHelper::merge() must be of the type array, null given, called in /var/www/drupal/web/modules/webform/includes/webform.translation.inc on line 63

sokru’s picture

Status: Needs review » Needs work
jrockowitz’s picture

To be able to fix this, I am going to need very specific steps on how to reproduce this issue using a default installation of Drupal and Webforms.

You should also review the langcode of the broken form.

sokru’s picture

Langcode of broken webform was originally EN, then later on FI.

I ended up fixing this by duplicating the broken form. Only difference in config export files is the UUID.

I will try to write more specific steps to reproduce this issue.

  • jrockowitz committed cb62d27 on 8.x-5.x
    Issue #2858766 by jrockowitz, gunwald: "Unable to display this webform....
jrockowitz’s picture

Status: Needs work » Fixed

I committed the patch. Please download the latest dev release to review.

Status: Fixed » Closed (fixed)

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