Fields being cleared when saving Product

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #13844

Hi Nicolas,

I have a custom field on my product form, displayed on both back and front end. Field type varchar(255) - I use this to input the supplier website, usually with a link similar to this <a href=" www.enta.net.au " target="_blank"> www.enta.net.au </a>

This works perfectly. However, whenever I go back in to the product to change any details, category, price etc this field is wiped out and replaced with just "<a href"

It means that every time I need to make a change to products, which is quite often - I have to re-enter the link.

Thanks and regards,
Jacqueline

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13399
  • MODERATOR
13 years 8 months ago #13915

The custom fields weren't supposed to handle HTML in the first place which is why it's not working properly. You need to change the line:
$html = $class->display($field,$value,$map,$inside,$options,$test);

by:
$html = $class->display($field,htmlspecialchars($value, ENT_COMPAT,'UTF-8'),$map,$inside,$options,$test);

in the file administrator/components/com_hikashop/classes/field.php
We'll add that as I'm sure it will help others as well.

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 1
13 years 8 months ago #13923

PERFECT!!

Thank you so much!

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum