- Posts: 136
- Thank you received: 1
Fields being cleared when saving Product
15 years 5 months ago #13844
by jacorr27
Fields being cleared when saving Product was created by jacorr27
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
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
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
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.
15 years 5 months ago #13915
by nicolas
Replied by nicolas on topic Re: Fields being cleared when saving Product
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.
$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.
15 years 5 months ago #13923
by jacorr27
Replied by jacorr27 on topic Re: Fields being cleared when saving Product
PERFECT!!
Thank you so much!
Thank you so much!
Please Log in or Create an account to join the conversation.
Time to create page: 0.203 seconds