VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Nilsy on August 19, 2016, 13:54:04 PM

Title: inch character not working
Post by: Nilsy on August 19, 2016, 13:54:04 PM
VM 3.0.16
J3.6.2
PHP Version 5.6.24
Apache

I know this has been taken up before, but I can't see any solution thread.

If I have a product title, for example: Chair only 22"
-The character " gets removed, and the page default to the 1064 syntax error.

The fault message I get is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Chair only 22"" ORDER BY product_name DESC, `virtuemart_product_id` DESC LIMI' at line 1 SQL=SELECT p.`virtuemart_product_id`, `l`.`product_name`,`l`.product_name FROM `#__virtuemart_products` as p INNER JOIN `#__virtuemart_products_nb_no` as l using (`virtuemart_product_id`) LEFT JOIN `#__virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` LEFT JOIN `#__virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` WHERE ( `pc`.`virtuemart_category_id` = 40 AND ( `ps`.`virtuemart_shoppergroup_id`= "5" OR `ps`.`virtuemart_shoppergroup_id` IS NULL ) AND p.`published`="1" ) AND p.`virtuemart_product_id`!="6726" AND `l`.product_name <= "Chair only 22"" ORDER BY product_name DESC, `virtuemart_product_id` DESC LIMIT 1
Title: Re: inch character not working
Post by: Studio 42 on August 19, 2016, 14:13:35 PM
I have already reported it for some weeks.
I think it's fixed in VM 3.0.17.6
The problem is "Chair only 22"", you have 2 time double quotes and this do an invalid mySql query.
A solution is to use the HTML code:
&quot;    standard
&#34;     numeric
&#x22;    hexa
Title: Re: inch character not working
Post by: Nilsy on August 19, 2016, 14:37:55 PM
Thank you... but where do I stick that code?
Or is it better just to write inch at the moment and wait for the update?
Title: Re: inch character not working
Post by: GJC Web Design on August 19, 2016, 14:52:19 PM
you manually use one of them in the title as u write it
Title: Re: inch character not working
Post by: Studio 42 on August 19, 2016, 16:18:27 PM
Replace in your product title Chair only 22" to Chair only 22&quot;
Note this can have side effect to, when product title is used in an encoded HTML tag, so the only valid solution is to remove the double quote or update VM.
Title: Re: inch character not working
Post by: Nilsy on August 22, 2016, 09:00:55 AM
 :-[ me being stupid...
-Note to self, please use glasses when reading...