From 4d35323f52841cd90e15cbfd0ca444ce624b294b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 16 Oct 2013 23:16:29 +0000 Subject: [PATCH] - More checks for sub-template referred to by partial name - Fix sub-template modifications missed if namespace mismatch --- etemplate/inc/class.etemplate_widget_template.inc.php | 3 +++ etemplate/js/et2_core_widget.js | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.etemplate_widget_template.inc.php b/etemplate/inc/class.etemplate_widget_template.inc.php index 910af6e6f5..dd56b53be8 100644 --- a/etemplate/inc/class.etemplate_widget_template.inc.php +++ b/etemplate/inc/class.etemplate_widget_template.inc.php @@ -62,6 +62,9 @@ class etemplate_widget_template extends etemplate_widget { list($c_app, $c_main, $c_sub) = explode('.',$c_name, 3); if($name == $c_sub) return $c_template; + + $parts = explode('.',$c_name); + if($name == $parts[count($parts)-1]) return $c_template; } } // Template not found, try again with content expansion diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index e424d4177b..437dcf98d0 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -643,7 +643,15 @@ var et2_widget = Class.extend( // Try again, but skip the fancy stuff // TODO: Figure out why the getEntry() call doesn't always work var entry = modifications.data[_node.getAttribute("id")]; - if(entry) this.egw().debug("warn", "getEntry("+_node.getAttribute("id")+") failed, but the data is there.", modifications, entry); + if(entry) + { + this.egw().debug("warn", "getEntry("+_node.getAttribute("id")+") failed, but the data is there.", modifications, entry); + } + else + { + // Try the root, in case a namespace got missed + var entry = modifications.getRoot().getEntry(_node.getAttribute("id")); + } } if(entry && entry.type) {