Error offsetExists() when i use 'twig_render_template' function

Created on 22 April 2021, over 3 years ago
Updated 16 May 2024, 6 months ago

Problem/Motivation

When i use drupal function "twig_render_template" like that

    $markup = twig_render_template(drupal_get_path('theme', 'my_theme') . '/templates/fields/advert.html.twig', [
      'number' => 1,
      'type' => 'small',
      'extra_class' => ['full-height','flex-center']
    ]);

I receive a message error :

Error: Call to a member function offsetExists() on null in Drupal\emulsify_twig\AddAttributesTwigExtension->add_attributes() (line 62 of modules/contrib/emulsify_twig/src/AddAttributesTwigExtension.php).
πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France vanilla-bear

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.

Production build 0.71.5 2024