diff --git a/etemplate/inc/class.etemplate_widget_template.inc.php b/etemplate/inc/class.etemplate_widget_template.inc.php index d474779658..c8dabc803a 100644 --- a/etemplate/inc/class.etemplate_widget_template.inc.php +++ b/etemplate/inc/class.etemplate_widget_template.inc.php @@ -55,6 +55,16 @@ class etemplate_widget_template extends etemplate_widget //error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') read from cache"); return self::$cache[$name]; } + // Template not found, try again as if $name were a partial name + else if(!$path && strpos('.',$name) === false) + { + foreach(self::$cache as $c_name => $c_template) + { + list($c_app, $c_main, $c_sub) = explode('.',$c_name, 3); + if($name == $c_sub) return $c_template; + } + } + error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found!"); return false; } @@ -77,6 +87,7 @@ class etemplate_widget_template extends etemplate_widget } } } + // template not found in file, should never happen error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found in file '$path'!"); return false; @@ -137,4 +148,4 @@ if ($GLOBALS['egw_info']['flags']['debug'] == 'etemplate_widget_template') } header('Content-Type: text/xml'); echo $template->toXml(); -} \ No newline at end of file +}