From ba46b48206818249f29ea2246e260f6fd5e42749 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 14 Apr 2023 10:45:19 -0600 Subject: [PATCH] Calendar: Fix error shown after importing ical "substr(): Argument #1 ($string) must be of type string, array given" --- calendar/inc/class.calendar_import_ical.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_import_ical.inc.php b/calendar/inc/class.calendar_import_ical.inc.php index ed11e15c30..6aca01a610 100644 --- a/calendar/inc/class.calendar_import_ical.inc.php +++ b/calendar/inc/class.calendar_import_ical.inc.php @@ -298,12 +298,18 @@ class calendar_import_ical implements importexport_iface_import_plugin { */ public function get_options_etpl(importexport_definition &$definition=null) { + $owner = $definition->plugin_options['owner'] ?? $GLOBALS['egw_info']['user']['account_id']; + // Make sure Owner from import dialog is not array + if(is_array($owner)) + { + $owner = array_pop($owner); + } return array( 'name' => 'calendar.import_ical', 'content' => array( 'file_type' => 'ical', 'charset' => $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'], - 'cal_owner' => [$definition->plugin_options['cal_owner'] ?: $GLOBALS['egw_info']['user']['account_id']] + 'cal_owner' => $owner ? [$owner] : null ), 'sel_options' => array( 'charset' => Api\Translation::get_installed_charsets(),