forked from extern/egroupware
Fix complex name finding to handle select options with label & value set, not just simple key => values
This commit is contained in:
parent
1ffdf3206c
commit
1811fd29c6
@ -426,15 +426,20 @@ class Select extends Etemplate\Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for non-trivial name like a[b]
|
// Check for non-trivial name like a[b]
|
||||||
|
$name_parts = explode('[',str_replace(array('[',']',']'),array('['),$name));
|
||||||
if(!$options)
|
if(!$options)
|
||||||
{
|
{
|
||||||
$options = (array)self::get_array(self::$request->sel_options,$name);
|
$options = (array)self::get_array(self::$request->sel_options,$name);
|
||||||
|
if(is_numeric(end($name_parts)) && $options['label'] && $options['value'])
|
||||||
|
{
|
||||||
|
// Too deep, we got a single option
|
||||||
|
$options = array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for base of name in root of sel_options
|
// Check for base of name in root of sel_options
|
||||||
if(!$options)
|
if(!$options)
|
||||||
{
|
{
|
||||||
$name_parts = explode('[',str_replace(array('[',']',']'),array('['),$name));
|
|
||||||
if (count($name_parts))
|
if (count($name_parts))
|
||||||
{
|
{
|
||||||
$org_name = $name_parts[count($name_parts)-1];
|
$org_name = $name_parts[count($name_parts)-1];
|
||||||
|
Loading…
Reference in New Issue
Block a user