possible bug with checked twig extension

freshjonesfreshjones Member
in Bugs & Feature Requests edited August 30
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 }}
Comments
  • fc_adamfc_adam FoxyCart Team
    @freshjones,

    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.