VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: DayCounts on October 23, 2012, 14:33:49 PM

Title: Router bug
Post by: DayCounts on October 23, 2012, 14:33:49 PM
Using VM2 on a Joomla 1.5 instance generates a bug in the SEF router.

The category route is an object that cannot be stored in cache :

in component/com_virtuemart/router.php
Replace
public function getCategoryRoute($virtuemart_category_id){

$cache = JFactory::getCache('_virtuemart','');
$key = $virtuemart_category_id. $this->vmlang ; // internal cache key
if (!($CategoryRoute = $cache->get($key))) {
$CategoryRoute = $this->getCategoryRouteNocache($virtuemart_category_id);
$cache->store($CategoryRoute, $key);
}
return $CategoryRoute ;
}

with
public function getCategoryRoute($virtuemart_category_id){

$cache = JFactory::getCache('_virtuemart','');
$key = $virtuemart_category_id. $this->vmlang ; // internal cache key
if (!($CategoryRoute = $cache->get($key))) {
$CategoryRoute = serialize($this->getCategoryRouteNocache($virtuemart_category_id));
$cache->store($CategoryRoute, $key);
}
return unserialize($CategoryRoute) ;
}

to prevent any issue