From 5566a9d97103dd056d2ce94ff86443461198e209 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 27 Oct 2020 10:29:46 -0600 Subject: [PATCH] Etemplate: Fix for Box not properly handling namespaces --- api/src/Etemplate/Widget/Box.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Box.php b/api/src/Etemplate/Widget/Box.php index 8ccdf127e4..84abce1364 100644 --- a/api/src/Etemplate/Widget/Box.php +++ b/api/src/Etemplate/Widget/Box.php @@ -50,7 +50,7 @@ class Box extends Etemplate\Widget $old_expand = $params[1]; if ($this->id && $this->type != 'groupbox') $cname = self::form_name($cname, $this->id, $params[1]); - if ($expand['cname'] !== $cname && $cname) + if ($expand['cname'] !== $cname && trim($cname) != '') { $expand['cont'] =& self::get_array(self::$request->content, $cname); $expand['cname'] = $cname; @@ -73,6 +73,11 @@ class Box extends Etemplate\Widget // Expand children $columns_disabled = null; + if($this->children[0] && strpos($this->children[0]->id, '$') !== false) + { + // Need to set this so the first child can repeat + $expand['row'] = 0; + } for($n = 0; ; ++$n) { if (isset($this->children[$n])) @@ -93,7 +98,7 @@ class Box extends Etemplate\Widget break; } //error_log('Running ' . $method_name . ' on child ' . $n . '(' . $child . ') ['.$expand['row'] . ','.$expand['c'] . ']'); - $disabled = $child->run($method_name, $params, $respect_disabled, $columns_disabled) === false; + $disabled = $child->run($method_name, [$cname,$expand], $respect_disabled, $columns_disabled) === false; } $params[0] = $old_cname;