(v 3.2) Webform: strip_tags(): Argument #1 ($string) must be of type string

Created on 6 January 2023, over 1 year ago
Updated 7 December 2023, 7 months ago

The error problem on line 146 in Droopler 3.1 is back.
When I try to add a file and upload it using Webform, I get the following error:

The website encountered an unexpected error. Please try again later.
TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in strip_tags() (line 146 of profiles/droopler/themes/custom/droopler_theme/droopler_theme.theme).
strip_tags(Array, '

') (Line: 146)
droopler_theme_preprocess_form_element(Array, 'form_element', Array)
call_user_func_array('droopler_theme_preprocess_form_element', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('form_element', Array) (Line: 489)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 39)
__TwigTemplate_62a8db3a00b8216c8c669a4d91587787->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('modules/webform/templates/webform-submission-form.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('webform_submission_form', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This bug was reported a few months ago and closed as resolved in v. 3.1 - unfortunately it has reappeared.

πŸ› Bug report
Status

Postponed: needs info

Version

3.1

Component

Code

Created by

πŸ‡΅πŸ‡±Poland pingwin_cracow

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡±Poland gpietrzak WrocΕ‚aw

    We will verify this and fix in 3.2 if possible

  • I cannot reproduce the problem.

    I tested as follows:
    On the new Droopler instance, I installed and enabled the webform module. Then I created a new form in which I added various fields (textfield, textarea, checkbox and all available file fields). After saving the form, I went to its preview, completed all the fields (added test files) and sent the form - The form submission was saved correctly, without errors, and there was nothing in the logs.
    I went back to editing the form and tried various ways to change the configuration of the form elements (title display, prefixes, etc.) - everything worked fine every time.

  • Status changed to Postponed: needs info 7 months ago
Production build 0.69.0 2024