Problem/Motivation

In my site with Drupal 10.6.17. I update from Webform 6.2.10 to webform 6.3.1 and all my site is down

I get this error:

TypeError: Twig\Runtime\EscaperRuntime::escape(): Argument #2 ($strategy) must be of type string, null given, called in /var/www/html/web/sites/default/files/php/twig/6ab6a5b8e24d4_webform-element-more.html_euh_/C7drXgL8.php on line 48 in Twig\Runtime\EscaperRuntime->escape() (line 94 of /var/www/html/vendor/twig/twig/src/Runtime/EscaperRuntime.php).
__TwigTemplate_a22fbcef465fd94dcf30bee1068630c7->doDisplay() (Line: 461)
Twig\Template->yield() (Line: 416)
Twig\Template->display() (Line: 431)
Twig\Template->render() (Line: 53)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 490)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 165)
Drupal\Core\Render\Renderer->{closure:Drupal\Core\Render\Renderer::renderInIsolation():164}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 164)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 868)
Drupal\webform\Hook\WebformTokensHooks->renderMore() (Line: 215)
Drupal\webform\Hook\WebformTokensHooks->tokenInfo() (Line: 17)
webform_token_info()
call_user_func_array() (Line: 416)
Drupal\Core\Extension\ModuleHandler->{closure:Drupal\Core\Extension\ModuleHandler::invokeAll():415}() (Line: 395)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 40)
Drupal\token\Token->getInfo() (Line: 100)
Drupal\token\Token->getTokenInfo() (Line: 57)
Drupal\token\TokenModuleProvider->resolveCacheMiss() (Line: 149)
Drupal\Core\Cache\CacheCollector->get() (Line: 49)
Drupal\token\TokenModuleProvider->getTokenModule() (Line: 1074)
Drupal\token\Hook\TokenTokensHooks->fieldTokens() (Line: 82)
Drupal\token\Hook\TokenTokensHooks->tokens() (Line: 609)
token_tokens()
call_user_func_array() (Line: 416)
Drupal\Core\Extension\ModuleHandler->{closure:Drupal\Core\Extension\ModuleHandler::invokeAll():415}() (Line: 395)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 368)
Drupal\Core\Utility\Token->generate() (Line: 691)
Drupal\token\Hook\TokenTokensHooks->tokens() (Line: 609)
token_tokens()

I can use the administration of the site or the site. I only get twig errors.

Issue fork webform-3626013

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

koffer created an issue. See original summary.

koffer’s picture

Issue summary: View changes

ayoub.elmansouri made their first commit to this issue’s fork.

alfynapoles’s picture

I can reproduce the same error on Drupal 10.6.17 with Webform 6.2.12 (not 6.3.1). In our case, the failure began when Composer updated twig/twig from v3.29.0 to v3.30.0; Webform was not updated in that deployment.

The stack trace likewise points to the compiled webform-element-more.html.twig and EscaperRuntime::escape() receiving null for $strategy. Reverting Twig to v3.29.0 resolves the issue. We have pinned Twig to v3.29.0 pending a compatible fix.

ayoub.elmansouri’s picture

Hi,

This issue is actually not caused by the Webform module, but by a recent change in Twig 3.30 which affects Drupal Core.

The bug is being actively tracked and handled in this Drupal Core issue:
https://www.drupal.org/project/drupal/issues/3625969

I have already tested the Merge Request MR !17242 from that core ticket, and it successfully resolves this TypeError problem.

I suggest closing this ticket as a duplicate or moving it to "Postponed" until the fix is merged into Drupal Core.

koffer’s picture

Thanks a lot for the answer. I try with another site and saw to problem (like you say) this is a problem with Drupal Core..

cilefen’s picture

Title: TypeError: Twig\Runtime\EscaperRuntime::escape Site down » TypeError: Twig\Runtime\EscaperRuntime::escape(): Argument #2 ($strategy) must be of type string, null given
cilefen’s picture

For what it's worth, the core bug crashes because a different function parameter is null, the fourth. This bug is about the second parameter.

liam morland’s picture

Version: 6.3.1 » 6.3.x-dev

There is a fix now for the core issue. Please see if applying that fix also fixes this issue.

ayoub.elmansouri’s picture

Status: Active » Closed (duplicate)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

koffer’s picture

I find why I get the error. when I update webform, twig update to.