Found bug in the Search of Virtuemart 2.9.9b and its solution!

Started by LorenzoPi, September 21, 2014, 21:08:44 PM

Previous topic - Next topic

LorenzoPi

Hi guys! I'm working with Virtuemart 2.9.9b for Joomla 3 and when i was searching various products on my site and changing some of the default filters ( for example the Orders of products or the Number of products in display ) the sistem didn't applied the filters and redirect me in Home page! So i search in the various files of Virtuemart and i saw this:
$getArray = vRequest::getGET();

To resolve this issue you must change this files:

- joomla\administrator\components\com_virtuemart\models\product.php

and replace line 2189 with $getArray = vRequest::getRequest();


- joomla\administrator\components\com_virtuemart\helpers\vmmodel.php

and replace line 1162 with $getArray = vRequest::getRequest();

Now the Search of Virtuemart 2.9.9b is working fine for me.

Milbo

It is more weird. the problem is that in joomla 3, the GET variables are not available, if you have SEF activated. It must be taken from the router then. To use Request is not good, cause it holds also the cookies. The fix is already in svn.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

So the solution is something like


if(JVM_VERSION<3){
$getArray = vRequest::getGet();
} else {
$router = JFactory::getApplication()->getRouter();
$getArray = filter_var_array($router->getVars(), FILTER_SANITIZE_STRING);
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

LorenzoPi