diff --git a/api/src/Etemplate/Widget/Entry.php b/api/src/Etemplate/Widget/Entry.php index 2cbbc7b66f..130693e764 100644 --- a/api/src/Etemplate/Widget/Entry.php +++ b/api/src/Etemplate/Widget/Entry.php @@ -178,7 +178,7 @@ abstract class Entry extends Transformer list($app, $type) = explode('-', $attrs['type']); $data_id = isset($attrs['value']) ? $attrs['value'] : $attrs['id']; $id = is_array($data) ? static::get_array($data, $data_id) : $data; - if(!$app || !$type || !$GLOBALS['egw_info']['apps'][$app] || !$id || + if(!$app || !$type || !isset($GLOBALS['egw_info']['apps'][$app]) || !$id || // Simple CF, already there isset($data[$attrs['field']]) ) diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index ff69c378d3..f1c20a669b 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -1683,13 +1683,14 @@ abstract class Merge { if(str_starts_with($cf_sub, '#')) { - $expand_sub_cfs[$cf[$index]] .= '$$' . $cf_sub . '$$ '; + $expand_sub_cfs[$cf[$index]] = (isset($expand_sub_cfs[$cf[$index]]) ? $expand_sub_cfs[$cf[$index]] : '') . + '$$' . $cf_sub . '$$ '; } } foreach($cf as $index => $field) { - if($cfs[$field]) + if(isset($cfs[$field])) { if(in_array($cfs[$field]['type'], array_keys($GLOBALS['egw_info']['apps']))) { @@ -1719,18 +1720,18 @@ abstract class Merge } // Get replacements for that application - if(!$app_replacements[$field]) + if(!isset($app_replacements[$field])) { // If we send the real content it can result in infinite loop of lookups // so we send only the used fields $content = $expand_sub_cfs[$field] ?? $matches[0][$index]; $app_replacements[$field] = $this->get_app_replacements($field_app, $values['#' . $field], $content); } - $replacements[$placeholders[$index]] = $app_replacements[$field]['$$' . $sub[$index] . '$$']; + $replacements[$placeholders[$index]] = $app_replacements[$field]['$$' . $sub[$index] . '$$'] ?? ''; } else { - if($cfs[$field]['type'] == 'date' || $cfs[$field]['type'] == 'date-time') + if(isset($cfs[$field]) && ($cfs[$field]['type'] == 'date' || $cfs[$field]['type'] == 'date-time')) { $this->date_fields[] = '#' . $field; } diff --git a/calendar/inc/class.calendar_holidays.inc.php b/calendar/inc/class.calendar_holidays.inc.php index a18e74a282..be0902799c 100644 --- a/calendar/inc/class.calendar_holidays.inc.php +++ b/calendar/inc/class.calendar_holidays.inc.php @@ -134,7 +134,7 @@ class calendar_holidays { ksort($data); } - error_log(__METHOD__."('$country', $year, $end_year) took ". number_format(microtime(true)-$starttime, 3).'s to fetch '.count(call_user_func_array('array_merge', $years)).' events'); + //error_log(__METHOD__."('$country', $year, $end_year) took ". number_format(microtime(true)-$starttime, 3).'s to fetch '.count(call_user_func_array('array_merge', $years)).' events'); unset($starttime); return $until_year ? $years : $years[$year]; diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index 578048197e..b218d1610c 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -351,7 +351,24 @@ class importexport_export_csv implements importexport_iface_export_record $names = array(); foreach($record->$name as $_name) { - $option = $selects[$name][$_name]; + $select_options = $selects[$name] ?? []; + $option = ''; + foreach($select_options as $key => $select_option) + { + if(is_array($select_option) && isset($select_option['value']) && $select_option['value'] == $name && isset($select_option['label'])) + { + $option = $select_option['label']; + break; + } + else + { + if($key == $name && !is_array($select_option)) + { + $option = $select_option; + break; + } + } + } $names[] = lang(is_array($option) && $option['label'] ? $option['label'] : $option); } $record->$name = implode(', ', $names);