VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: ptrouw on October 22, 2014, 10:05:08 AM

Title: Product Name is showing acii code instead of character
Post by: ptrouw on October 22, 2014, 10:05:08 AM
VM2.9.9e: Instead of showing a single quote in Product name, it is showing ACSII '
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on October 24, 2014, 13:55:48 PM
One more note on this behaviour, after installing 2.2.9g or 2.2.9.2 it got worse!
My product name is Audi '11. After saving product name it is changed to: Audi A1 '11. (front-end interpreted correctly)
After saving item again it now shows: Audi ' Which makes no sense, of course front end isn't able to show this.
Title: Re: Product Name is showing acii code instead of character
Post by: Milbo on October 24, 2014, 22:08:10 PM
thx
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on December 13, 2014, 14:08:03 PM
Using J3.3 and VM 3.0.2 problem still partly exist!
In product view every thing is fine, as well as in the admin.
Only the breadcrumb isn't correct, showing ascii code: ' => Audi A1 3d '11- reistassen set
instead of the product_name: Audi A1 3d '11- reistassen set.

Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on January 22, 2015, 15:41:16 PM
Problem still exist in several places.
1. Saving a product with a quote, like Test '12, generates wrong product alias: test-39-12. Where 39 stands for the ascii coding.
2. Second is the breadcrumb is still wrong, showing: test '12
3. This reflects also the meta page title and meta description.

I solved the breadcrumb in with a quick work around: $new_name = html_entity_decode($list[$i]->name);
Changing in my case: ' to an   apostrophe (single quote)

I assume this is a bug. Hopefully this can be fixed soon.
Title: Re: Product Name is showing acii code instead of character
Post by: Milbo on January 28, 2015, 12:46:20 PM
Thank you
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on January 29, 2015, 14:02:38 PM
Quote from: Milbo on January 28, 2015, 12:46:20 PM
Thank you
Do you expect this to be fixed in next release?
Title: Re: Product Name is showing acii code instead of character
Post by: Milbo on January 31, 2015, 00:35:29 AM
you did try?
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on February 27, 2015, 15:07:08 PM
Yes, running now 3.0.4 and still the same problem: Peugeot 308 '07-'13 3/5d set de sacs de voyage. Which should be: Peugeot 308 '07-'13 3/5d set de sacs de voyage
Title: Re: Product Name is showing acii code instead of character
Post by: jenkinhill on February 27, 2015, 15:38:42 PM
I just tried that and the only place it shows like your example is in the Joomla generated title tag, <title>Hats : Peugeot 308 &amp;#39;07-&amp;#39;13 3/5d set de sacs de voyage</title> 

It is fine everywhere else including the meta description and on the product pages. Is that what you are seeing?
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on February 27, 2015, 15:45:25 PM
You are almost right, yes it is the title tag: <meta content="Peugeot 308 &#39;07-&#39;13 3/5d travel bag set" name="title">
But some other places as well. External component Xmap, shows it incorrect. And before I used a patch, the breadcrumb was incorrect as well.
Thanks for looking in to it.
Title: Re: Product Name is showing acii code instead of character
Post by: thewitt on February 27, 2015, 17:21:58 PM
html_decode_entities needs to be called with the appropriate flags as well every time the product name is pulled from the database and is going to be displayed. This is not always done.
Title: Re: Product Name is showing acii code instead of character
Post by: Milbo on February 28, 2015, 12:26:32 PM
Thank you
found
Quote
if ($product->customtitle) {
            $document->setTitle(strip_tags(html_entity_decode($product->customtitle,ENT_QUOTES)));
         } else {
            $document->setTitle(strip_tags(html_entity_decode(($category->category_name ? ($category->category_name . ' : ') : '') . $product->product_name,ENT_QUOTES)));
         }
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on February 28, 2015, 12:59:29 PM
Hey Milbo,

Which file should I edit?

cheers Paul
Title: Re: Product Name is showing acii code instead of character
Post by: GJC Web Design on February 28, 2015, 23:03:58 PM
components\com_virtuemart\views\productdetails\view.html.php  ~ line 217
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on March 01, 2015, 12:33:15 PM
Yes this works fine for the title, but I think the problem is already at the core.

The biggest bug still exist, and that is saving a product with a quote, like Peugeot 308 '07-'13 generates wrong product alias: "peugeot-308-39-07-39-13". Where 39 stands for the ascii coding.
And furthermore the product name saves like: Peugeot 308 &#39;07-&#39;13

Strangely enough this is done only for the other installed languages. Default Dutch is fine, but EN/DE/FR is wrong.

Any thoughts?
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on March 18, 2015, 23:11:04 PM
I am running J3.4 and VM3.0.6 but this bug is still there. Does someone have an idea were to solve this?
Which file is responsible to write the product name into specific language dependent product database table.
Title: Re: Product Name is showing acii code instead of character
Post by: Milbo on March 19, 2015, 18:58:09 PM
vm3.0.6.3?
Title: Re: Product Name is showing acii code instead of character
Post by: ptrouw on March 25, 2015, 18:16:34 PM
Hey Milbo,

Just upgraded to j3.4.1 and VirtueMart 3.0.6.4.
Unfortunately it isn't solved yet. I included a screen-shot. You can see the original product name in default Dutch language is: Seat Leon '05-'12 reistassen set
and the German product name is: Seat Leon &#39;05-&#39;09 Reisetaschen Set

There has been one change I noticed, the automatic generated alias created off the product name is fine now and working great!
So Dutch alias is: seat-leon-05-12-reistassen-set
and German generated alias is: seat-leon-09-12-reisetaschen-set