VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: berghoff on March 10, 2015, 12:39:19 PM

Title: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: berghoff on March 10, 2015, 12:39:19 PM
Hi.
Just migrated to vm3 and noticed an error:
virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in product name:
You can examine it over link below:
http://www.posudy.net/katalog-tovarov/search.html?keyword=1112466&limitstart=0&option=com_virtuemart&view=category&virtuemart_category_id=0
the result looks OK and when I select the desided goods I receive:

Error: 1064 - 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 'Vision Premium"" ORDER BY `l`.product_name DESC LIMIT 1' at line 1 SQL=SELECT p.`virtuemart_product_id`, `l`.`product_name` FROM `edgb_virtuemart_products` as p INNER JOIN `edgb_virtuemart_products_ru_ru` as l using (`virtuemart_product_id`) LEFT JOIN `edgb_virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` LEFT JOIN `edgb_virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` WHERE ( `pc`.`virtuemart_category_id` = 16 AND ( `ps`.`virtuemart_shoppergroup_id`= "1" OR `ps`.`virtuemart_shoppergroup_id` IS NULL ) AND p.`published`="1" ) AND p.`virtuemart_product_id`!="2859" AND `l`.product_name <= "12 пр. Набор посуSPAMы "Vision Premium"" ORDER BY `l`.product_name DESC LIMIT 1

isn't it easier just to use virtuemrat_product_id?

Waiting for your reccomendations.
Title: Re: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: Milbo on March 10, 2015, 19:46:34 PM
It is the sql searching for the neighboured products. The name of the product has two "" and they are not correctly encoded there. It is strange, I took the name of your product and cannot reproduce it.
Title: Re: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: berghoff on March 11, 2015, 09:20:08 AM
Now i see it is not the search issue.

You can find the product name and another samples in category below:
http://www.posudy.net/katalog-tovarov/berghoff/posuda/vision.html

I can easily replace the "" but I'm not sure it is the right solution and i do not want to make any modifications to virtuemart because of its update process witch overwrites all files.

Waiting for your ideas.

Found the solution to replace " with &quot; ower the link below: http://forum.virtuemart.net/index.php?topic=119483.0

Title: Re: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: Milbo on March 11, 2015, 16:01:45 PM
I changed that, works except in the search. that is atm the only problem
Title: Re: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: siao on October 20, 2015, 22:30:50 PM
in VM 3.0.10 the same problem
product pages with old products named with double quotes show sql error 1064
if I create new product with double quotes so page with proiduct details look good.
What should I do for repair this?
thanks
Title: Re: virtuemart 3.0.6.2 search module results mysql error 1064 of quotes in pr.name
Post by: GJC Web Design on October 21, 2015, 13:52:32 PM
do a general search replace in your vm products titles to replace " with &#34;

(double check I have   &#34;  correct! -- from memory)