- Posts: 36
- Thank you received: 5
Code Showing on Product Options Combo Box
4 years 20 hours ago #346430
by Manuel TT
VC22
Code Showing on Product Options Combo Box was created by Manuel TT
-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.33
Hello,
Just wanted to report that, under a very specific Hikashop configuration and product setup, HTML code showed up on the combo box for selecting product options (see image attached).
I turned Joomla debug mode on and set Joomla error reporting to maximum and no error was shown reported.
This occurred with a product (P) that had a Characteristic (C) where the first value of C was 0 (the digit zero) and P had P has it's own characteristic. After finding this out I tested placing P as an option in another unrelated product and the same thing (code showing up on combo box for selecting product options) happened.
So I do think this 'display error' happens when a product option is displayed where it's value is 0 (the digit zero). Not surprising given the 'powers' of zero in coding
.
I don't have a problem with this, just changed the characteristic value to "0.0" and all is OK (thankfully the code didn't take 0.0 as meaning 0!). I also tested with 1 has a characteristic value (to rule out this happened with single digit strings) and no problem in this case.
Though a minor and easy to circumvent 'error' I share this because it might lead the Dev team to find and fix other similar occurrences that could have more serious effects.
I'm sure you'll have a good laugh when you find how this come about in the code
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.33
Hello,
Just wanted to report that, under a very specific Hikashop configuration and product setup, HTML code showed up on the combo box for selecting product options (see image attached).
I turned Joomla debug mode on and set Joomla error reporting to maximum and no error was shown reported.
This occurred with a product (P) that had a Characteristic (C) where the first value of C was 0 (the digit zero) and P had P has it's own characteristic. After finding this out I tested placing P as an option in another unrelated product and the same thing (code showing up on combo box for selecting product options) happened.
So I do think this 'display error' happens when a product option is displayed where it's value is 0 (the digit zero). Not surprising given the 'powers' of zero in coding
I don't have a problem with this, just changed the characteristic value to "0.0" and all is OK (thankfully the code didn't take 0.0 as meaning 0!). I also tested with 1 has a characteristic value (to rule out this happened with single digit strings) and no problem in this case.
Though a minor and easy to circumvent 'error' I share this because it might lead the Dev team to find and fix other similar occurrences that could have more serious effects.
I'm sure you'll have a good laugh when you find how this come about in the code
VC22
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
4 years 16 hours ago #346433
by nicolas
Replied by nicolas on topic Code Showing on Product Options Combo Box
Hi,
Thanks for the report !
Add the code:
before the line:
in the file components/com_hikashop/views/product/tmpl/option.php and it will fix the problem. We'll add the change on our end for the next version of HikaShop too.
Thanks for the report !
Add the code:
Code:
if($selectionMethod == 'generic')
$text = strip_tags($text);
Code:
$this->row =& $variant;
Please Log in or Create an account to join the conversation.
Time to create page: 0.060 seconds