Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal 10.3 Element children from User Error to throw an exception breaks any non render array (but still array) output #462

Open
DiegoPino opened this issue Sep 2, 2024 · 0 comments
Assignees
Labels
Drupal 10 Upgrade economy external bug It is not us, it is them Twig Extension Make those flowers reach the sun
Milestone

Comments

@DiegoPino
Copy link
Member

What?

Drupal! Devs (to make tests pass and use the new PHP UNIT 10 stuff) made a large breaking change. Any Array output via {{ data.i_am_an_array }} will no longer show a user error on screen but will basically kill the page.

See https://git.drupalcode.org/project/drupal/-/commit/3d645c1b3c

The reason is someone decided to override in Drupal Core the normal Twig Escape Extension (the default)

Which in turn calls this code with a silly message (no, not handled!!!)

  // This is a normal render array, which is safe by definition, with
  // special simple cases already handled.
  
  // Early return if this element was pre-rendered (no need to re-render).
    if (isset($arg['#printed']) && $arg['#printed'] == TRUE && isset($arg['#markup']) && strlen($arg['#markup']) > 0) {
      return $arg['#markup'];
    }
    $arg['#printed'] = FALSE;
    return $this->renderer->render($arg);

And $this->renderer->render($arg);

and renderer::render will call
Renderer.php:462, Drupal\Core\Render\Renderer->doRender()
Element.php:97, Drupal\Core\Render\Element::children()

Throwing an exception nobody is catching and not only failing to render a single piece, but the whole page

I need to think how to override for our use case this. There is a LOT of code happening and too many layers.

@DiegoPino DiegoPino self-assigned this Sep 2, 2024
@DiegoPino DiegoPino added external bug It is not us, it is them Twig Extension Make those flowers reach the sun Drupal 10 Upgrade economy labels Sep 2, 2024
@DiegoPino DiegoPino added this to the 1.5.0 milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drupal 10 Upgrade economy external bug It is not us, it is them Twig Extension Make those flowers reach the sun
Projects
None yet
Development

No branches or pull requests

1 participant