Etemplate: Fix for Box not properly handling namespaces

This commit is contained in:
nathangray 2020-10-27 10:29:46 -06:00
parent ad933b63ae
commit 5566a9d971

View File

@ -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;