From 3ad903ad21cc6a4254d246b8baeb057ecc65442c Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Tue, 13 Aug 2013 20:54:59 +0000 Subject: [PATCH] - bugfix the internal resource cache did not observe config_dir changes (forum topic 24493) --- change_log.txt | 3 +++ libs/sysplugins/smarty_resource.php | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 32cc0527..f3900134 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +13.08.2013 +- bugfix the internal resource cache did not observe config_dir changes (forum topic 24493) + 12.08.2013 - bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149) diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 63b63b43..3fc072c6 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -97,11 +97,16 @@ abstract class Smarty_Resource * * @param Smarty $smarty Smarty instance * @param string $resource_name resource_name to make unique + * @param boolean $is_config flag for config resource * @return string unique resource name */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false) { - return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name; + if ($is_config) { + return get_class($this) . '#' . $smarty->joined_config_dir . '#' . $resource_name; + } else { + return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name; + } } /** @@ -562,7 +567,7 @@ abstract class Smarty_Resource // load resource handler, identify unique resource name $resource = Smarty_Resource::load($smarty, $type); - $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name); + $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name, true); // check runtime cache $_cache_key = 'config|' . $unique_resource_name;