This is exactly what i have in file administrator\components\com_virtuemart\models\category.php in the store function :
public function store(&$data) {
vRequest::vmCheckToken();
$table = $this->getTable('categories');
if ( !array_key_exists ('category_template' , $data ) ){
$data['category_template'] = $data['category_layout'] = $data['category_product_layout'] = 0 ;
}
if(VmConfig::get('categorytemplate') == $data['category_template'] ){
$data['category_template'] = 0;
}
if(VmConfig::get('categorylayout') == $data['category_layout']){
$data['category_layout'] = 0;
}
if(VmConfig::get('productlayout') == $data['category_product_layout']){
$data['category_product_layout'] = 0;
}
$table->bindChecknStore($data);
if(!empty($data['virtuemart_category_id'])){
$xdata['category_child_id'] = (int)$data['virtuemart_category_id'];
$xdata['category_parent_id'] = empty($data['category_parent_id'])? 0:(int)$data['category_parent_id'];
$xdata['ordering'] = empty($data['ordering'])? 0: (int)$data['ordering'];
$table = $this->getTable('category_categories');
$table->bindChecknStore($xdata);
}
// Process the images
$mediaModel = VmModel::getModel('Media');
$file_id = $mediaModel->storeMedia($data,'category');
$conf = JFactory::getConfig();
$options = array(
'defaultgroup' => '',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => $conf->get('cache_path', JPATH_SITE . '/cache')
);
$cache = JCache::getInstance('', $options);
$cache->clean('com_virtuemart_cats');
$cache->clean('mod_virtuemart_product');
$cache->clean('mod_virtuemart_category');
return $data['virtuemart_category_id'] ;
}
When i disable the cache in Joomla, all this 3 folders com_virtuemart_cats, mod_virtuemart_product, mod_virtuemart_category are removed and if i enable the cache this work same.
Of course, at the moment you refresh a page in the front, the com_virtuemart_cats folder are regenerate, because this cache is forced in virtuemart.
I don't try to solve the foced cache problem, but my problem was that on saving a category, this was not refreshed in the 3 core caches using categories.
P.S: this fix is running on my test server without any error in my error log seens 4 days now.