VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: LorenzoPi on September 21, 2014, 21:08:44 PM

Title: Found bug in the Search of Virtuemart 2.9.9b and its solution!
Post by: LorenzoPi on September 21, 2014, 21:08:44 PM
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.
Title: Re: Found bug in the Search of Virtuemart 2.9.9b and its solution!
Post by: Milbo on September 22, 2014, 11:17:45 AM
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.
Title: Re: Found bug in the Search of Virtuemart 2.9.9b and its solution!
Post by: Milbo on September 22, 2014, 11:25:46 AM
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);
}
Title: Re: Found bug in the Search of Virtuemart 2.9.9b and its solution!
Post by: LorenzoPi on September 22, 2014, 14:28:05 PM
Thank you very much! It works perfectly  :)