Index: branches/5.2.x/core/units/helpers/category_helper.php =================================================================== diff -u -N -r14244 -r14560 --- branches/5.2.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 14560) @@ -1,6 +1,6 @@ Application->isCachingType(CACHING_TYPE_MEMORY)) { - $data = $this->Application->getCache('master:StructureTree', false); + if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { + $data = $this->Application->getCache('master:StructureTree', false, CacheSettings::$structureTreeRebuildTime); } else { - $data = $this->Application->getDBCache('StructureTree'); + $data = $this->Application->getDBCache('StructureTree', CacheSettings::$structureTreeRebuildTime); } if ($data) { @@ -452,6 +452,13 @@ return $data; } + if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { + $this->Application->rebuildCache('master:StructureTree', kCache::REBUILD_NOW, CacheSettings::$structureTreeRebuildTime); + } + else { + $this->Application->rebuildDBCache('StructureTree', kCache::REBUILD_NOW, CacheSettings::$structureTreeRebuildTime); + } + // generate structure tree from scratch $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); /* @var $ml_helper kMultiLanguageHelper */ @@ -472,17 +479,24 @@ function getTemplateMapping() { - if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { - $data = $this->Application->getCache('master:template_mapping', false); + if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { + $data = $this->Application->getCache('master:template_mapping', false, CacheSettings::$templateMappingRebuildTime); } else { - $data = $this->Application->getDBCache('template_mapping'); + $data = $this->Application->getDBCache('template_mapping', CacheSettings::$templateMappingRebuildTime); } - if ($data) { + if ( $data ) { return unserialize($data); } + if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { + $this->Application->rebuildCache('master:template_mapping', kCache::REBUILD_NOW, CacheSettings::$templateMappingRebuildTime); + } + else { + $this->Application->rebuildDBCache('template_mapping', kCache::REBUILD_NOW, CacheSettings::$templateMappingRebuildTime); + } + $sql = 'SELECT IF(c.`Type` = ' . PAGE_TYPE_TEMPLATE . ', CONCAT(c.Template, ":", c.ThemeId), CONCAT("id:", c.CategoryId)) AS SrcTemplate, LOWER(