From 6ef849c9a7b73a6dd3f43e2e1154d7d275a2d161 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 3 Aug 2016 09:57:49 -0600 Subject: [PATCH] Fix attempting to set array value accessed via magic methods was silently ignored by changing and setting the whole array --- calendar/importexport/class.import_events_csv.inc.php | 4 +++- calendar/inc/class.calendar_import_ical.inc.php | 4 +++- importexport/importexport_cli.php | 4 +++- infolog/inc/class.infolog_import_infologs_csv.inc.php | 6 ++++-- timesheet/inc/class.timesheet_import_csv.inc.php | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/calendar/importexport/class.import_events_csv.inc.php b/calendar/importexport/class.import_events_csv.inc.php index 52923ed499..4f14a0ddbd 100644 --- a/calendar/importexport/class.import_events_csv.inc.php +++ b/calendar/importexport/class.import_events_csv.inc.php @@ -127,8 +127,10 @@ class import_events_csv implements iface_import_plugin { } // set eventOwner - $_definition->plugin_options['events_owner'] = isset( $_definition->plugin_options['events_owner'] ) ? + $plugin_options = $_definition->plugin_options; + $plugin_options['events_owner'] = isset( $_definition->plugin_options['events_owner'] ) ? $_definition->plugin_options['events_owner'] : $this->user; + $_definition->plugin_options = $plugin_options; // trash_users_records ? if ( $_definition->plugin_options['trash_users_records'] === true ) { diff --git a/calendar/inc/class.calendar_import_ical.inc.php b/calendar/inc/class.calendar_import_ical.inc.php index dc20624726..f8155491ce 100644 --- a/calendar/inc/class.calendar_import_ical.inc.php +++ b/calendar/inc/class.calendar_import_ical.inc.php @@ -132,9 +132,11 @@ class calendar_import_ical implements importexport_iface_import_plugin { return; } // switch off notifications by default + $plugin_options = $_definition->plugin_options; if (!isset($_definition->plugin_options['no_notification'])) { - $_definition->plugin_options['no_notification'] = true; + $plugin_options['no_notification'] = true; + $_definition->plugin_options = $plugin_options; } // User wants conflicting events to not be imported if($_definition->plugin_options['skip_conflicts']) diff --git a/importexport/importexport_cli.php b/importexport/importexport_cli.php index 783ab1be07..4e10b8bd57 100755 --- a/importexport/importexport_cli.php +++ b/importexport/importexport_cli.php @@ -142,7 +142,9 @@ if( $definition->get_identifier() < 1 ) { $GLOBALS['egw_info']['flags']['currentapp'] = $definition->application; -$definition->plugin_options['dry_run'] = $dryrun; +$plugin_options = $definition->plugin_options; +$plugin_options['dry_run'] = $dryrun; +$definition->plugin_options = $plugin_options; $type = $definition->type; $po = new $definition->plugin; diff --git a/infolog/inc/class.infolog_import_infologs_csv.inc.php b/infolog/inc/class.infolog_import_infologs_csv.inc.php index 8c92e945ec..382af85c4c 100644 --- a/infolog/inc/class.infolog_import_infologs_csv.inc.php +++ b/infolog/inc/class.infolog_import_infologs_csv.inc.php @@ -151,9 +151,11 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin { } // set Owner - $_definition->plugin_options['record_owner'] = $_definition->plugin_options['record_owner'] ? + $plugin_options = $_definition->plugin_options; + $plugin_options['record_owner'] = $_definition->plugin_options['record_owner'] ? $_definition->plugin_options['record_owner'] : $this->user; - $_definition->plugin_options['record_owner'] = $this->user; + $plugin_options['record_owner'] = $this->user; + $_definition->plugin_options = $plugin_options; $_lookups = array( 'info_type' => $this->boinfolog->enums['type'], diff --git a/timesheet/inc/class.timesheet_import_csv.inc.php b/timesheet/inc/class.timesheet_import_csv.inc.php index d019cd5ab7..f899717c50 100644 --- a/timesheet/inc/class.timesheet_import_csv.inc.php +++ b/timesheet/inc/class.timesheet_import_csv.inc.php @@ -144,8 +144,10 @@ class timesheet_import_csv implements importexport_iface_import_plugin } // set Owner - $_definition->plugin_options['record_owner'] = isset( $_definition->plugin_options['record_owner'] ) ? + $plugin_options = $_definition->plugin_options; + $plugin_options['record_owner'] = isset( $_definition->plugin_options['record_owner'] ) ? $_definition->plugin_options['record_owner'] : $this->user; + $_definition->plugin_options = $plugin_options; // Used to try to automatically match names to account IDs $addressbook = new Api\Contacts\Storage();