From be9fcea5c543773b8a1d45ac3a1a1286c6a5083c Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 4 Feb 2021 14:48:22 -0700 Subject: [PATCH] Etemplate: Make sure all attributes get expanded --- api/src/Etemplate/Widget.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget.php b/api/src/Etemplate/Widget.php index 59ed4c980e..4ba85a16a5 100644 --- a/api/src/Etemplate/Widget.php +++ b/api/src/Etemplate/Widget.php @@ -577,12 +577,20 @@ class Widget */ protected function expand_widget(Widget &$child, array &$expand) { + $attrs = $child->attrs; + unset($attrs['type']); + foreach($attrs as $name => &$value) + { + $value = self::expand_name($value,$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']); + } + if($attrs['attributes']) + { + $attrs = array_merge($attrs, $attrs['attributes']); + } if(strpos($child->attrs['type'], '@') !== false || strpos($child->attrs['type'], '$') !== false) { $type = self::expand_name($child->attrs['type'],$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']); $id = self::expand_name($child->id,$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']); - $attrs = $child->attrs; - unset($attrs['type']); $expanded_child = self::factory($type, false,$id); $expanded_child->id = $id; $expanded_child->type = $type;