1

So I've updated my Magento install from 2.2.2 to 2.2.5 and now it seems all my product attributes with 'allowed HTML' turned on get escaped.

So the value for the front-end is:

<a href="https://www.google.com">Google</a>

What gets return when opening a product page:

 &lt;a href=&quot;https://www.google.com&quot;&gt;Google&lt;/a&gt;

While the links were working before now they are broken. I've wiped all cache, resaved the product attribute, changed the product attributes, all to no avail.

Anybody got any idea what could be the problem?

1
  • Click on show/hide editor on your attribute then paste the html and check again. Jul 15, 2018 at 19:42

2 Answers 2

0

Go to Stores > Attributes > Product and select the attribute in the grid. Set Is HTML Allowed on Front to Yes. Flush the cache and reindex.

4
  • I've done all that already. "HTML Allowed on Front-end" was already checked since it was working on 2.2.2 before. Just not after the upgrade.
    – Asphyxion
    Jul 16, 2018 at 19:07
  • Its quite possible that Magent introduced a __('string escape') to it Jul 16, 2018 at 19:50
  • I've done a clean install of Magento 2.2.5 through Softaculous which showcased the same issue. So I think it might be 2.2.5 indeed.
    – Asphyxion
    Jul 16, 2018 at 20:14
  • Did you ever get this issue resolved? I had to resolve this exact issue for a client yesterday. I can share the fix if you still need it. Jul 19, 2018 at 12:34
0

Not an optimum solution. But can Try with using html_entity_decode function under extreme conditions.

2
  • 1
    Sorry but this is not a good solution. It’s better to become familiar with the platform instead of fixing something that isn’t broken. Jul 16, 2018 at 6:57
  • @ShawnAbramson Sure, updated my answer, just in case :)
    – Gagan
    Jul 16, 2018 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.