News:

Support the VirtueMart project and become a member

Main Menu

Issue on product creation with name with quote

Started by chabi01, October 24, 2020, 12:07:09 PM

Previous topic - Next topic

chabi01

Hi everybody,

I have notice a little issue with product name when created.
What is happening :

I am a french native, and in french, we often have name like "L'ARTICLE...." with a "   '   ".
I have my product listed in Calc/Excel file.
To create my product (manually or imported with some tools like CSVImport, it is the same), i can see this issue :

I create a new product,
I copy paste from Calc/Excel the name, and all other information.
If now this a child product shown in a dropdown for a parent product, i have the name shown correctly in the backend and in the list, but shown like this in the frontend :
In the backend : "L'ARTICLE......"
In the frontend : "L1#39;ARTICLE..."

I have then to edit again the child product, copy paste again the name or manually erase the ' to retype it correctly.

I was thinking first "it is a pagecode issue with the excel file", but this is not the reason as if i edit and copy paste again the name, the issue is no more existing..

Do you know a way to avoid this issue ? Is this a bug in the code on product creation ?
This is quite annoying as if i import several hundred products, i have to manually correct all the name with " ' "...

Thanks for the help :)
Xavier

pinochico

QuoteI was thinking first "it is a pagecode issue with the excel file", but this is not the reason as if i edit and copy paste again the name, the issue is no more existing..

It's reason
- microsoft has set up code page another as your administration from VirtueMart
- microsoft products are "shit" - when I copy text from MS product to text editor, then text is with a lot of mass (style, font define...)

Then, if you copy text, copy text from MS product first to Notepad and then to VM.
Try self, I think this help for you.

Or you can hack internal function in VM for product Title (but I don't know where is exactly now).
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

diri

Hint: Search function is of help at some time as well as basic knowledge of HTML ...

To make story short:

&prime = single quote
&Prime = double quote

If nothing changed in VM those entities are not filtered.

Hope it helps,

diri

chabi01

Hi everybody,
Thanks for your lights :)

If i use a Linux with LibreOffice, is the problem could solved then ?
Why this question : If this is linked to MSOffice, why the issue is still existing if i open the file under Linux with LibreOffice, and export to CSV using the filter edition in UTF8 ? The csv file should have the MS page code no ?
Moreover, why is this happening on the product creation but not on product edition ??

Thanks again :)
Xavier

chabi01

Hello,
I saw the issue is not always linked to the import file !
If I have name with quotes inside, especially for children product, on each save, the issue is back.
Then, if i have as name "My product L'Or", the name is replaced in the database in "My product L'Or"...

The only way i found so far is to replace all the products name in the database with a :
UPDATE xxxxx_virtuemart_products_fr_fr SET product_name = REPLACE(product_name, ''', '\'')

This correct my issue but not the problem : each time i'm going to edit and save a parent product, this will mess up all the name of the children...

Where is the function in the file to save and update the product : i have to check where is the problem if possible (i cannot work like this).
Otherwise, i could add a function to "correct" the quote, but again, this is not "normal" no ?

Thanks for the help:)
Xavier

chabi01

The editor remove the code i want to show.
Read :
Then, if i have as name "My product L'Or", the name is replaced in the database in "My product L'Or"...

and for the sql :
UPDATE xxxxx_virtuemart_products_fr_fr SET product_name = REPLACE(product_name, ''', '\'')

Xavier

chabi01

Maybe a "Virtuemart master" here could tell me how to correct this in the file calling the children is the dropdown list as the issue is only in the dropdown ? If the code is in the database but shown correctly in the dropdown, it could help while the issue is not corrected...

Thanks for the help :)
Xavier

chabi01

Ok, i have made a video to show you : this is obviously a bug in Virtuemart !
Check the video and you will understand the bug i have.

Video is to big (1,4Mo) : i have created a wetransfer file here : https://we.tl/t-Tlpf0NTfXl
Note : i add to zip the file (it is a mkv video file).

So, my question is still here and maybe someone can help me to find a way to solve this : every time i save a parent product with children, their name are "broken"...

Xavier

chabi01

Nobody can help me ??
Maybe is this fixable quickly with an htmlspecialchars_decode ?
If yes, where is generate the dropdown list for children product ? I found the customfield.php file but i cannot find the right line to modify...

Please help !
Xavier

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chabi01

Hi,
Ok, sor far, i see the text value  in  line 156 :
$text = $elem;

And as the text value is used as it on line 174 with :
$o->text = $text;

it should use the correct value if i replace the line 156 with :

$text = htmlspecialchars_decode($elem, ENT_QUOTES);

Unfortunately, it seems to not work...

GCJ, do you a mistake in my code or in the logic ?

Thanks a lot for your help :)
Xavier


chabi01

Strange... to verify if something change in the list, i put something to "view" with $text = $elem . 'xxxxx';
should change each list value to show my "xxx" in the string in the list  no ?

Nothing change... not sure this is the right place or there is something I miss here....

Xavier

jjk

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

GJC Web Design

Quoteto verify if something change in the list, i put something to "view" with $text = $elem . 'xxxxx';
should change each list value to show my "xxx" in the string in the list  no ?

correct

is your customfield.php over ridden in templates/your_template/html/com_virtuemart/sublayouts?

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chabi01

Hi :)


I did the change in my template override (and after this, as i have no results, i did also in the virtuemart component folder to be sure) : no results after modify the files..

By the way, thanks JJK for your advice.

I keep trying... no success so far.
Xavier