You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since data.html.twig, has been refactored with commit c5902ed into a macro, the context variables like base_url are no longer accessible.
By design, Twig macros do not have access to the context.
When the form uses display and/or email actions, all variables are being passed to data.html.twig but since its refactoring into a macro, it does not have access to the context anymore.
This can be fixed as follows:
Pass the context into the macro, by altering the top and bottom line in data.html.twig as follows:
{% macro render_field(form, fields, scope, context) %}
{# Note: Use context to access available variables #}
...
{{ macro.render_field(form, form.fields, '', _context) }}
Access the variables using context, like {{ context.base_url_absolute }}
The text was updated successfully, but these errors were encountered:
Since data.html.twig, has been refactored with commit c5902ed into a macro, the context variables like
base_url
are no longer accessible.By design, Twig macros do not have access to the context.
When the form uses
display
and/oremail
actions, all variables are being passed to data.html.twig but since its refactoring into a macro, it does not have access to the context anymore.This can be fixed as follows:
context
, like{{ context.base_url_absolute }}
The text was updated successfully, but these errors were encountered: