VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: lopezalejandro on February 01, 2013, 21:28:39 PM

Title: ERROR and FIX for VM JRoute
Post by: lopezalejandro on February 01, 2013, 21:28:39 PM
Hi! Max and VM Team!
I and Dajo (Artio Joomsef Team) found an error on viertuemart JRoute.

<option value="/gardentools/?limit=2&amp;amp;limitstart=6">2</option>

Notice the amp;amp; part - there should be only one amp;. This causes problems when JoomSEF converts URLs to SEF.

The fix needs to be applied in the /administrator/components/com_virtuemart/helpers/vmmodel.php file.

1. Open the /administrator/components/com_virtuemart/helpers/vmmodel.php file in text editor
2. In class VmPagination find the function getLimitBox()
3. In that function between lines 699 and 710 there is the function JRoute::_() called multiple times, for example the following line:

$limits[]=JHtml::_('select.option', JRoute::_( $link.'&limit='. $items), $items);


4. Find every occurence of the JRoute::_() function call and add one parameter to it with value "false", so the line from previous step will become:

$limits[]=JHtml::_('select.option', JRoute::_( $link.'&limit='. $items, false), $items);


notice the ", false" being added inside the JRoute::_() function call

This should fix the multiple amp; problem.

The problem is that by default the JRoute::_() function already uses &amp; in the generated URL, but Joomla's JHTML::_('select.genericlist') function used later replaces the "&" character with another "&amp;".

Pleas, fix it for the next version :) Thanks!!
Title: Re: ERROR and FIX for VM JRoute
Post by: wanderschaft on February 03, 2013, 11:40:35 AM
... I have a similar problem when the user ist changing the list limit step within a category/categories view. then the modules disapear (because Item Id is lost)

index.php?option=com_virtuemart&amp;view=category&amp;virtuemart_category_id=14&amp;Itemid=326&amp;limit=20
this works better (without "amp"):
index.php?option=com_virtuemart&view=category&virtuemart_category_id=14&Itemid=326&limit=20

vm 2.0.18a
j2.5.7
Title: Re: ERROR and FIX for VM JRoute
Post by: Milbo on February 03, 2013, 19:00:35 PM
Thank you very much lopezalejandro and Dajo