VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Rikard on May 31, 2018, 07:51:41 AM

Title: Problem with ' changed into ' in titles
Post by: Rikard on May 31, 2018, 07:51:41 AM
Hi
I've got a site with four languages, english is the default language. When I add product titles such as "It's a Happy Cake" and save in english everything looks fine. Then when I switch to another language the ' is replaced with '. So far so good, problem is that it's not shown as ' in the frontend, it is shown as '. This can of course be the template, or joomla or whatever. But, there is something strange in VM as well, because everytime I open the product, another ' is added to the title. The front end reads "It's a Happy Cake". Please note the absent & from the second instance. This is true for all duplicates that are added by entering the product over and over.

I have tested with a few more special characters and the same is true for " (inch) but I didn't find this behaviour for any other special characters.

My system
-----
Virtuemart: 3.2.14
Joomla: 3.8.8
php: 7.1.17-1+ubuntu16.04.1+deb.sury.org+1
-----

Best regards,
Rikard
Title: Re: Problem with ' changed into ' in titles
Post by: Milbo on May 31, 2018, 12:13:54 PM
That is indeed a very interesting observation. I have no real answer now. Must have something todo with the language locale of php.
Title: Re: Problem with ' changed into ' in titles
Post by: StefanSTS on May 31, 2018, 12:25:07 PM
I can confirm this behaviour for ' and " in VM 3.2.14.

If the backend language is EN, the english product name is saved with the ' or ". The product name in the other language is saved with an escape character.
Product 'something
After another save it becomes:
Product 'something

If you switch the backend language the problem occurs vice versa.
Means the product name is always saved normally (without escape characters) in the used backend language.

Title: Re: Problem with ' changed into ' in titles
Post by: Milbo on June 05, 2018, 22:32:15 PM
Hmm, means that we need to set the language locale extra. the language locale tells php how to interprete. I am not sure about that, but could be an explanation.