[Skip to main content](#vessel-content)

#   Fields being cleared when saving Product

##

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#13844](#13844) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  *[Fields being cleared when saving Product](/forum/3-bug-report/13844-fields-being-cleared-when-saving-product#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   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 &quot;")* was created by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")*

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 &lt;a href="[ www.enta.net.au](http://www.enta.net.au)" target="_blank"&gt;[ www.enta.net.au](http://www.enta.net.au)&lt;/a&gt;

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 "&lt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xMzg0NC1maWVsZHMtYmVpbmctY2xlYXJlZC13aGVuLXNhdmluZy1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86552
- Thank you received: 14304
-
-

15 years 7 months ago [\#13915](#13915) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Fields being cleared when saving Product](/forum/3-bug-report/13844-fields-being-cleared-when-saving-product#13915 "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   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 &quot;")*

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-&gt;display($field,$value,$map,$inside,$options,$test);

by:
$html = $class-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xMzg0NC1maWVsZHMtYmVpbmctY2xlYXJlZC13aGVuLXNhdmluZy1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")**
- [![jacorr27's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/626-jacorr27 "View jacorr27's Profile") Topic Author
- [ Offline](/forum/user/626-jacorr27)

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#13923](#13923) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Re: Fields being cleared when saving Product](/forum/3-bug-report/13844-fields-being-cleared-when-saving-product#13923 "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   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 &quot;")*

PERFECT!!

Thank you so much!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xMzg0NC1maWVsZHMtYmVpbmctY2xlYXJlZC13aGVuLXNhdmluZy1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
