Index: C:/www/39/kernel/classes/ezcontentcachemanager.php =================================================================== --- C:/www/39/kernel/classes/ezcontentcachemanager.php (revision 18955) +++ C:/www/39/kernel/classes/ezcontentcachemanager.php (working copy) @@ -45,6 +45,7 @@ */ // Clear cache types +define( 'EZ_VCSC_CLEAR_NO_CACHE' , 0 ); define( 'EZ_VCSC_CLEAR_NODE_CACHE' , 1 ); define( 'EZ_VCSC_CLEAR_PARENT_CACHE' , 2 ); define( 'EZ_VCSC_CLEAR_RELATING_CACHE' , 4 ); @@ -298,7 +299,8 @@ if ( $ini->hasGroup( $classID ) ) { $info = array(); - $info['dependent_class_identifier'] = $ini->variable( $classID, 'DependentClassIdentifier' ); + if ( $ini->hasVariable( $classID, 'DependentClassIdentifier' ) ) + $info['dependent_class_identifier'] = $ini->variable( $classID, 'DependentClassIdentifier' ); if ( $ini->hasVariable( $classID, 'MaxParents' ) ) $info['max_parents'] = $ini->variable( $classID, 'MaxParents' ); @@ -315,7 +317,11 @@ if ( is_array( $type ) ) { - if ( in_array( 'all', $type ) ) + if ( in_array( 'none', $type ) ) + { + $info['clear_cache_type'] = EZ_VCSC_CLEAR_NO_CACHE; + } + elseif ( in_array( 'all', $type ) ) { $info['clear_cache_type'] = EZ_VCSC_CLEAR_ALL_CACHE; } @@ -412,6 +418,17 @@ function nodeListForObject( &$contentObject, $versionNum, $clearCacheType, &$nodeList ) { $assignedNodes =& $contentObject->assignedNodes(); + + + // determine if $contentObject has dependent objects for which cache should be cleared too. + $objectClassIdentifier = $contentObject->attribute( 'class_identifier' ); + $dependentClassInfo = eZContentCacheManager::dependencyInfo( $objectClassIdentifier ); + + //Check if clear_cache_type on class type is none before we begin + if ( $dependentClassInfo['clear_cache_type'] == EZ_VCSC_CLEAR_NO_CACHE ) + { + $clearCacheType = $dependentClassInfo['clear_cache_type']; + } if ( $clearCacheType & EZ_VCSC_CLEAR_NODE_CACHE ) { @@ -438,10 +455,6 @@ eZContentCacheManager::appendSiblingsNodeIDs( $assignedNodes, $nodeList ); } - // determine if $contentObject has dependent objects for which cache should be cleared too. - $objectClassIdentifier = $contentObject->attribute( 'class_identifier' ); - $dependentClassInfo = eZContentCacheManager::dependencyInfo( $objectClassIdentifier ); - if ( $dependentClassInfo['clear_cache_type'] & EZ_VCSC_CLEAR_SIBLINGS_CACHE ) { eZContentCacheManager::appendSiblingsNodeIDs( $assignedNodes, $nodeList ); @@ -780,18 +794,20 @@ if ( $ini->variable( 'ContentSettings', 'StaticCache' ) == 'enabled' ) { include_once( 'kernel/classes/ezstaticcache.php' ); - include_once( 'kernel/classes/ezcontentcachemanager.php' ); $staticCache = new eZStaticCache(); + $nodes = array(); - eZContentCacheManager::nodeListForObject( $object, true, EZ_VCSC_CLEAR_DEFAULT, $nodes); - - foreach ( $nodes as $nodeID ) - { - $aNode = eZContentObjectTreeNode::fetch( $nodeID ); - if ( is_object( $aNode ) ) - $staticCache->cacheURL( "/" . $aNode->urlAlias(), $nodeID ); - } - $staticCache->generateAlwaysUpdatedCache(); + eZContentCacheManager::nodeListForObject( $object, true, EZ_VCSC_CLEAR_DEFAULT, $nodes ); + // If no nodes returns it means that ClearCacheMethod[]=none + if ( count( $nodes )) + { + foreach ( $nodes as $nodeID ) + { + $aNode = eZContentObjectTreeNode::fetch( $nodeID ); + if ( is_object( $aNode ) ) + $staticCache->cacheURL( "/" . $aNode->urlAlias(), $nodeID ); + } + $staticCache->generateAlwaysUpdatedCache(); + } } eZDebug::accumulatorStop( 'generate_cache' );