VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: woodybz on May 13, 2013, 11:43:08 AM

Title: Double amp on select generic child variant
Post by: woodybz on May 13, 2013, 11:43:08 AM
Hi!

It's my first bug report and I'm not sure to explain very well the situation.

I reproduce the problem in a new VM installation with the sample data.
I use two different default joomla template: Atomic for the vm-shop and Beez2 for the other pages. (The problem still be present with other combination of templates).

On the product details view of "Hand shovel", we can select the Hand Shovel type (it is a "Generic child variant" custome field type).
When I select a different type, the output is a url with a double amp and the result is that the layout go to the Beez2 template and don't stay on the Atomic one.

Here is the example:
The url of product details page:
http://pionieri.crialtoadige.it/sito/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1&virtuemart_category_id=1&Itemid=129 (http://pionieri.crialtoadige.it/sito/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1&virtuemart_category_id=1&Itemid=129)

The url after select a different generic child variant:
http://pionieri.crialtoadige.it/sito/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=1&virtuemart_product_id=13&Itemid=129 (http://pionieri.crialtoadige.it/sito/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=1&virtuemart_product_id=13&Itemid=129)

PHP 5.2.17
Joomla 2.5.11
VM 2.0.20b

Hope it could be useful for solve the problem! Thanks for your attention!

Woody
Title: Re: Double amp on select generic child variant
Post by: CE WebDesign München on May 25, 2013, 17:56:43 PM
it is the same in my case, if VM SEO & Joomla SEO is off:

http://localhost/cms/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=75&virtuemart_category_id=3&lang=en
http://localhost/cms/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=3&virtuemart_product_id=76&lang=en

but does it matter, if SEO's are on? (J 2.5.11 & VM 2.0.20b)
Title: Re: Double amp on select generic child variant
Post by: Milbo on May 26, 2013, 12:03:32 PM
lol, I just checked it and found out that the normal link created by JRoute (disabled SEF) is creating the & . I set now the  second parameter to false and it works.

if ($xhtml)
{
$url = htmlspecialchars($url);
}


Why they do this? Hmmmm interesting, in fact it is a missing trailing slash. When there is a trailing slash the URL remains untouched. lol But that is stupid. With trailing slash there wont be any SEF, anylonger. So looks like we must add everywhere the second parameter. But it would be easier if joomla changes the standard behaviour. I still dont get the trick to escape a link
Title: Re: Double amp on select generic child variant
Post by: CE WebDesign München on May 26, 2013, 16:42:55 PM
thanks for the info, so it is a joomla issue?

I only found this:

"If the user turns off SEF URLs in the site's settings, JRoute::_ will produce working non-SEF URLs
without any changes to the code." http://docs.joomla.org/Supporting_SEF_URLs_in_your_component#The_Concept

but I'm sorry, this is way beyond my skills...
Title: Re: Double amp on select generic child variant
Post by: Milbo on May 27, 2013, 00:09:27 AM
I have a version here, in which I hopefully fixed it. Set almost everywhere as second parameter false. seems to work now