Jump to content

[BUG] Extra attributes in templates aren't properly spaced

Recommended Posts

Using the Form helper there's an option (the 4th one) to pass additional attributes as an array. Passing a single attribute is okay, but if you pass multiple ones the attributes are all attached with no space separating them.


The fix is to edit the template "\applications\core\dev\html\admin\forms\template.phtml" on line 2:

<form accept-charset='utf-8' data-formId="{$id}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm class="{$formClass}" {{foreach $attributes as $k => $v}}{$k}="{$v}"{{endforeach}} {{if \count($tabArray) > 1}}novalidate="true"{{endif}}>

You need to add a space inside the $attributes foreach (adding one before {{endforeach}} is enough):

{{foreach $attributes as $k => $v}}{$k}="{$v}" {{endforeach}}




EDIT: Well, right after posting I decided to try a mass search with a partial text and it seems that are a lot more locations that aren't adding a proper space when there are multiple attributes provided:

{{foreach $attributes as $k


Some use $k / $v, some other templates use $key / $value, etc. My search returned 47 results in 45 different files. 😋

Edited by teraßyte
Link to comment
Share on other sites

  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...