Author Topic: Issue on product creation with name with quote  (Read 935 times)

chabi01

  • Beginner
  • *
  • Posts: 40
Issue on product creation with name with quote
« on: October 24, 2020, 12:07:09 pm »
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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 812
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Issue on product creation with name with symbols
« Reply #1 on: October 24, 2020, 13:06:19 pm »
Quote
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..

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 from products, orders and database table
Virtuemart Email Manager - customs email templates

diri

  • Jr. Member
  • **
  • Posts: 120
  • VirtueMart Version: most recent dev version (trunk)
Re: Issue on product creation with name with symbols
« Reply #2 on: October 25, 2020, 09:18:02 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #3 on: October 26, 2020, 10:49:40 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #4 on: November 09, 2020, 11:48:09 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #5 on: November 09, 2020, 11:50:13 am »
The editor remove the code i want to show.
Read :
Code: [Select]
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 :
Code: [Select]
UPDATE xxxxx_virtuemart_products_fr_fr SET product_name = REPLACE(product_name, ''', '\'')
Xavier

chabi01

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #6 on: November 09, 2020, 12:19:01 pm »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #7 on: November 10, 2020, 19:29:03 pm »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with symbols
« Reply #8 on: November 13, 2020, 18:23:51 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9901
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Issue on product creation with name with quote
« Reply #9 on: November 13, 2020, 19:25:41 pm »
starts around line 160

see image
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chabi01

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with quote
« Reply #10 on: November 16, 2020, 18:11:11 pm »
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

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with quote
« Reply #11 on: November 16, 2020, 18:16:06 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3700
  • using Matomo instead of Google Analytics
Re: Issue on product creation with name with quote
« Reply #12 on: November 16, 2020, 21:51:03 pm »
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9901
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Issue on product creation with name with quote
« Reply #13 on: November 16, 2020, 22:44:59 pm »
Quote
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 ?

correct

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

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chabi01

  • Beginner
  • *
  • Posts: 40
Re: Issue on product creation with name with quote
« Reply #14 on: November 17, 2020, 16:32:01 pm »
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