The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

possible bug with checked twig extension

freshjonesfreshjones Member
in Bugs & Feature Requests edited August 2017
in your twig templates you use a twig extension to determine if a checkbox/radio button should be checked or not, like so

{{ checked(payment_method_type, 'plastic_new') }}

however if you look at the code...twig is converting the true quotes to their htmlentity counterpart, "

everything still works but things look rather odd...such as when looking through firefox devtools it looks like this

<input type="radio" checked=""checked"" name="fc_payment_method">

and when looking at the page source code it looks like this

<input type="radio" checked=&quot;checked&quot; name="fc_payment_method">

it all still works but just seems odd so I thought I'd let you know...

since I'm using my own versions of the 2.0 template files I was able to fix this by adjusting with raw like so

{{ checked(payment_method_type, 'plastic_new')|raw }}
  • fc_adamfc_adam FoxyCart Team

    Ah - great catch, you are right! I'll create a ticket on our side to look into that and get it corrected. As you noted it does still work - but we'll want to get that corrected to ensure it doesn't cause unforeseen issues in the future. Thanks for letting us know!
Sign In or Register to comment.