Open Pierre-RA opened 7 years ago
Hey,
let me check that tonight! There might be some changes in Bolt 3.2.x that broke this.
Phillipp
Alright, thank you!
+1 any news about this extension?
@christophermh44 Sorry, I completely forgot it. too much to do recently. Will have a look at it soon.
I am running Bolt 3.2.13
, and I fixed this runtime error by calling "attribute" instead of "attr" in the extended profile templates.
Go to extensions/ohlandt/user-profiles/templates
and in the field templates change
macro.attr(attr_text)
, macro.attr(attr_opt)
and macro.attr(attr_checkbox)
to macro.attribute(attr_text)
for text, macro.attribute(attr_opt)
for select, and macro.attribute(attr_checkbox)
for checkbox fields respectively.
I hope this helps. @PhillippOhlandt I hope you finally get to fix this in the extension.
cc: @christophermh44, @Pierre-RA
@PhillippOhlandt please check open PR.
UPDATE: The above edits fix this issue, but a new one seems to emerge. The attributes don't seem to be generated for respective input fields, but I'm thinking "attribute" is the correct function for the same. See https://twig.symfony.com/doc/2.x/functions/attribute.html
Any ideas?
Thanks :)
You're welcome @christophermh44. I realised however that my solution from before was a bit rash and messed up with the dynamic attributes and database writes.
What you need to do is add {% from '@bolt/_macro/_macro.twig' import attr %}
to the top of each of the four input field templates, then find all instances of {{ macro.attr(attr_text) }}
, {{ macro.attr(attr_opt) }}
and {{ macro.attr(attr_checkbox) }}
and delete the macro.
from the twig function. Leave everything else as it is.
This works for me, and I hope this works for anyone else who encounters the error.
UPDATE: I have made the necessary edits to my pull requests, which are available to merge. Feel free to review the code.
cc: @PhillippOhlandt
With
bolt 3.2.5
, when accessing the page/bolt/profile
I get this error:Twig_Error_Runtime
inTemplate.php
line230
: An exception has been thrown during the rendering of a template ("Calling "attr" on template "@bolt/_macro/_macro.twig" from template "field_textarea.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0.") in "@bolt/edituser/edituser.twig" at line 53.When I remove the line in question, I still get the error for the file
field_text.twig
. It seems that callingmacro.attr(attr_text)
is generating the error.Any ideas?