From 94aba179612f82a1d3e0ebf47791084eec51e38c Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 13 Sep 2024 13:04:48 +0200 Subject: [PATCH] fix ajax_get_options does not use default of true for globalCategories --- api/src/Etemplate/Widget/Select.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Select.php b/api/src/Etemplate/Widget/Select.php index d85759ca90..02d0568da1 100644 --- a/api/src/Etemplate/Widget/Select.php +++ b/api/src/Etemplate/Widget/Select.php @@ -716,7 +716,12 @@ class Select extends Etemplate\Widget case 'select-cat': // !$type == globals cats too, $type2: extraStyleMultiselect, $type3: application, if not current-app, $type4: parent-id, $type5=owner (-1=global),$type6=show missing $application = self::expand_name($widget->attrs['application'], 0, 0, '', '', self::$cont) ?? $type3; - $globalCategories = self::expand_name($widget->attrs['globalCategories'], 0, 0, '', '', self::$cont) ?? $type ?? 'true'; + $globalCategories = self::expand_name($widget->attrs['globalCategories'], 0, 0, '', '', self::$cont) ?? $type; + // set default of true (ajax_get_options uses a legacy_options string, which means nothing set is "") + if ($globalCategories === null || $globalCategories === '') + { + $globalCategories = true; + } $parentCat = self::expand_name($widget->attrs['parentCat'], 0, 0, '', '', self::$cont) ?? $type4; if((!$application || $application === $GLOBALS['egw']->categories->app_name) &&