Under circumstances where admin pages preview AT markup, the {{ html_element }} variable in some AT core templates may not be defined and result in malformed HTML.
I assume this is because html_element is normally defined in AT_core (\includes\preprocess.inc and/or \includes\misc.inc), and those functions do not run within an administration context.
This would rarely affect a site visitor, but it would be ideal if all AT twig templates using this variable had a default value to prevent this malformed HTML from displaying, regardless of whether the user is on an admin page or not.
Something like:
<{{ html_element|default('div') }}{{ attributes }}>
{{ content }}
</{{ html_element|default('div') }}>
That said, any solution that prevented malformed HTML from showing up would be great.
Comments
Comment #2
jwkovell commentedAttached patch adds a default value to the html_element variable in the following at_core layout_plugin templates.
This resolved the issue on our site, but alternative solutions are welcome.
Comment #3
Jeff Burnz commentedI don't know how I missed this, quite a while ago I noticed this also and fixed it a similar way:
Probably the
default()filter is more elegant actually - nice!Comment #7
Jeff Burnz commentedDone.
Comment #8
jwkovell commentedExcellent. Thanks!