- Posts: 69
- Thank you received: 1
Filter accepts a quote but admin form.php does not
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
11 years 4 months ago #206668
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.25
Hi,
I have a radio button custom field being used as a filter. When the filter value of the field has a double quote in it, the admin product/form.php form does not recognize the value, and when that value is selected and saved, the form removes the quote mark from the value (the value with the quote mare was placed there via an import).
In my case the quote mark is a single quote used to represent inches.. so for example 14" for 14 inches
Here is a screen shot of the filter value
prntscr.com/7mqkaj
Here is one of my products (the center one) after I selected 14" in admin product/form.php and saved it
Notice that the inch mark... the double quote, has been deleted from this produce (it was there prior... but did not show as selected in the admin form)
prntscr.com/7mql2t
Please advise how to fix this.
Thanks,
Dennis
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.25
Hi,
I have a radio button custom field being used as a filter. When the filter value of the field has a double quote in it, the admin product/form.php form does not recognize the value, and when that value is selected and saved, the form removes the quote mark from the value (the value with the quote mare was placed there via an import).
In my case the quote mark is a single quote used to represent inches.. so for example 14" for 14 inches
Here is a screen shot of the filter value
prntscr.com/7mqkaj
Here is one of my products (the center one) after I selected 14" in admin product/form.php and saved it
Notice that the inch mark... the double quote, has been deleted from this produce (it was there prior... but did not show as selected in the admin form)
prntscr.com/7mql2t
Please advise how to fix this.
Thanks,
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 4 months ago #207240
by nicolas
Replied by nicolas on topic Filter accepts a quote but admin form.php does not
Hi,
Thank you for your feedback.
Add the line:
$oneValue = htmlentities($oneValue, ENT_COMPAT, 'UTF-8');
before the line:
$checked .= ((is_string($value) && $oneValue === $value) || is_array($value) && in_array($oneValue,$value)) ? 'checked="checked" ' : '';
in the file administrator/components/com_hikashop/classes/field.php
That should fix the problem.
Thank you for your feedback.
Add the line:
$oneValue = htmlentities($oneValue, ENT_COMPAT, 'UTF-8');
before the line:
$checked .= ((is_string($value) && $oneValue === $value) || is_array($value) && in_array($oneValue,$value)) ? 'checked="checked" ' : '';
in the file administrator/components/com_hikashop/classes/field.php
That should fix the problem.
The following user(s) said Thank You: dkmetz@taylorbruce.com
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #207542
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
Nicolas,
This worked... thank you! Will this fix be in a future lease? If so, do you know which release?
Thanks again,
Dwennis
This worked... thank you! Will this fix be in a future lease? If so, do you know which release?
Thanks again,
Dwennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #207556
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
Nicolas,
I am having the exact same issue... but now with the ® (as in Kevlar®) and the ™ and the ² (as in 10 oz/yd²) symbols... the fix for the double quote works just fine.
Dennis
I am having the exact same issue... but now with the ® (as in Kevlar®) and the ™ and the ² (as in 10 oz/yd²) symbols... the fix for the double quote works just fine.
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 4 months ago - 11 years 4 months ago #207545
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Filter accepts a quote but admin form.php does not
The fix will be in the next version of HikaShop.
Thanks to stop using special characters in values. You're not supposed to do that. You should put the special characters only in the title of your custom field values and keep a simple value. Then, it will work just fine and it won't look any different to what you have.
Thanks to stop using special characters in values. You're not supposed to do that. You should put the special characters only in the title of your custom field values and keep a simple value. Then, it will work just fine and it won't look any different to what you have.
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 11 years 4 months ago by nicolas.
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #207566
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
Hmmm...
Not really the answer I was looking for... and not consistent with your last reply.
Remember... data needs to have integrity both on import AND on export.
Dennis
Not really the answer I was looking for... and not consistent with your last reply.
Remember... data needs to have integrity both on import AND on export.
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 4 months ago #207611
by nicolas
Replied by nicolas on topic Filter accepts a quote but admin form.php does not
Hi,
I don't see why that would be a problem with the import/export or with my previous answer.
When you have a value with a different title, the value is used for the export/import and the storing in the database. The title is only used for the display on the website.
I don't see why that would be a problem with the import/export or with my previous answer.
When you have a value with a different title, the value is used for the export/import and the storing in the database. The title is only used for the display on the website.
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #207651
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
Nicolas,
Thank you for your prompt reply... here is my situation. I have data imported and the data has values that get changed via a product save... and thus do not work as filters... here is why:
Take for example a product with a custom field that has the double quote used for inches... my data has a value of 14" in it and that did not work, because when I saved that item using the admin from.php, that item stripped out the inch mark for that item/product. Now when I search for 14" I do not see that product... before I saved that product, I did. Also, I use that value elsewhere for display... and now all the other items have 14" displayed, but that item was saved has 14 displayed. BUT you fixed this for me by making a change to the field.php class.
I have other fields like this one... with other special characters... and need to be able to have them fixed, as you did for the inch mare, for example:
FIELD TITLE - FIELD VALUE
Fabric Weight - 10 oz/yd²
When I go to a product... and do nothing but save the product, the Fabric Weight field becomes null and is no longer displayed on the front end... and of course I now have a product that I cannot find using this value as the filter.
You recognized this as an issue for the inch symbol... why would the ® (as in Kevlar®) and the ™ and the ² (as in 10 oz/yd²) symbols be any different?
How can I import a value of 10 oz/yd² and keep it un-altered after a product save?
What am I missing?
Dennis
Thank you for your prompt reply... here is my situation. I have data imported and the data has values that get changed via a product save... and thus do not work as filters... here is why:
Take for example a product with a custom field that has the double quote used for inches... my data has a value of 14" in it and that did not work, because when I saved that item using the admin from.php, that item stripped out the inch mark for that item/product. Now when I search for 14" I do not see that product... before I saved that product, I did. Also, I use that value elsewhere for display... and now all the other items have 14" displayed, but that item was saved has 14 displayed. BUT you fixed this for me by making a change to the field.php class.
I have other fields like this one... with other special characters... and need to be able to have them fixed, as you did for the inch mare, for example:
FIELD TITLE - FIELD VALUE
Fabric Weight - 10 oz/yd²
When I go to a product... and do nothing but save the product, the Fabric Weight field becomes null and is no longer displayed on the front end... and of course I now have a product that I cannot find using this value as the filter.
You recognized this as an issue for the inch symbol... why would the ® (as in Kevlar®) and the ™ and the ² (as in 10 oz/yd²) symbols be any different?
How can I import a value of 10 oz/yd² and keep it un-altered after a product save?
What am I missing?
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #207774
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
The ampersand and the comma also do not work
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
- dkmetz@taylorbruce.com
-
Topic Author
- Offline
Less
More
- Posts: 69
- Thank you received: 1
11 years 4 months ago #208001
by dkmetz@taylorbruce.com
______________
Dennis Kmetz
Replied by dkmetz@taylorbruce.com on topic Filter accepts a quote but admin form.php does not
Nicolas,
Can you let me know the status of this request.
Thanks,
Dennis
Can you let me know the status of this request.
Thanks,
Dennis
______________
Dennis Kmetz
Please Log in or Create an account to join the conversation.
11 years 1 month ago #215366
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Filter accepts a quote but admin form.php does not
Hi,
Like I wrote in the post #207545 ; you should not use complexe values for the custom fields.
The goal of the value is to be just a value and you can put the text you want for the label.
But if you want something which work fine ; you must keep the value as simple as possible.
Filters are using the values of the custom fields, so when you have a "dropdown" field, it will list all values and generate the filters. And still, it will use the value as internal value with the label as the customer display information.
That is the correct way to use custom fields and use them with filters.
If you use complexe values with special characters, I understand that you will face issues when submitting the filter.
I also understand that you do not appreciate my answer but the current structure of the fields with the different elements which secure the fields values ; you just can't.. I'm sorry but that's not my fault, I'm just the messenger.
Regards,
Like I wrote in the post #207545 ; you should not use complexe values for the custom fields.
The goal of the value is to be just a value and you can put the text you want for the label.
But if you want something which work fine ; you must keep the value as simple as possible.
Filters are using the values of the custom fields, so when you have a "dropdown" field, it will list all values and generate the filters. And still, it will use the value as internal value with the label as the customer display information.
That is the correct way to use custom fields and use them with filters.
If you use complexe values with special characters, I understand that you will face issues when submitting the filter.
I also understand that you do not appreciate my answer but the current structure of the fields with the different elements which secure the fields values ; you just can't.. I'm sorry but that's not my fault, I'm just the messenger.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.082 seconds