Fixed bug with board comments - if the document had no comments, any new one added would not be displayed.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9436 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-09-29 10:27:02 +00:00
parent efe84d96a7
commit c9fed498f7

View file

@ -893,6 +893,27 @@ class documentController extends document {
$args->last_updater = $last_updater;
}
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport())
{
$cache_key = 'object:'.$document_srl;
$oCacheHandler->delete($cache_key);
$cache_object = $oCacheHandler->get('module_list_documents');
if(isset($cache_object) && is_array($cache_object)){
foreach ($cache_object as $object){
$cache_key_object = $object;
$oCacheHandler->delete($cache_key_object);
}
}elseif(!is_array($cache_object)) {
$oCacheHandler->delete($cache_key_object);
}
$oCacheHandler->delete('module_list_documents');
//remove document item from cache
$cache_key = 'object_document_item:'.$document_srl;
$oCacheHandler->delete($cache_key);
}
return executeQuery('document.updateCommentCount', $args);
}