Permalink
Browse files

Correctly clear node.info as well as stat when deleting a folder cach…

…e by key.
  • Loading branch information...
1 parent 18f6118 commit dddf87ca4bff62ad1cd73fb87858cf122462d34a @cdujeu cdujeu committed Oct 4, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/src/plugins/core.cache/CoreCacheLoader.php
@@ -126,10 +126,10 @@ public function clearNodeInfoCache($from=null, $to=null, $copy = false){
if(empty($cDriver) || !($cDriver->supportsPatternDelete(AJXP_CACHE_SERVICE_NS_NODES))){
return;
}
- if($from != null){
+ if($from !== null){
$this->clearCacheForNode($from);
}
- if($to != null){
+ if($to !== null && ($from === null || $from->getUrl() !== $to->getUrl())){
$this->clearCacheForNode($to);
}
}
@@ -188,6 +188,7 @@ protected function clearCacheForNode($node){
}else {
// Delete node data and all its children
$cacheDriver->deleteKeyStartingWith(AJXP_CACHE_SERVICE_NS_NODES, AbstractCacheDriver::getOptionsForNode($node, "stat")["id"]);
+ $cacheDriver->deleteKeyStartingWith(AJXP_CACHE_SERVICE_NS_NODES, AbstractCacheDriver::getOptionsForNode($node, "node.info")["id"]);
if($node->getParent() !== null){
$cacheDriver->deleteKeyStartingWith(AJXP_CACHE_SERVICE_NS_NODES, AbstractCacheDriver::getOptionsForNode($node->getParent(), "list")["id"]);
}else{

0 comments on commit dddf87c

Please sign in to comment.