From 7631eb83aae6c5b710333638bcb1ff447fdec280 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 20 Mar 2020 10:31:30 -0600 Subject: [PATCH] Fix some account changes were not saved --- api/src/Accounts.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/api/src/Accounts.php b/api/src/Accounts.php index 15f2b6db61..5f728f3090 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -641,18 +641,21 @@ class Accounts $old['account_lastname'] != $data['account_lastname'] || $old['account_email'] != $data['account_email'])) { - if (!$data['person_id']) $data['person_id'] = $old['person_id']; + if (!$data['person_id']) + { + $data['person_id'] = $old['person_id']; + } // Include previous contact information to avoid blank history rows - $contact = (array)$GLOBALS['egw']->contacts->read($data['person_id']) + array( - 'n_given' => $data['account_firstname'], - 'n_family' => $data['account_lastname'], - 'email' => $data['account_email'], - 'account_id' => $data['account_id'], - 'id' => $data['person_id'], - 'owner' => 0, - ); - $GLOBALS['egw']->contacts->save($contact,true); // true = ignore addressbook acl + $contact = array_merge((array)$GLOBALS['egw']->contacts->read($data['person_id']), array( + 'n_given' => $data['account_firstname'], + 'n_family' => $data['account_lastname'], + 'email' => $data['account_email'], + 'account_id' => $data['account_id'], + 'id' => $data['person_id'], + 'owner' => 0, + )); + $GLOBALS['egw']->contacts->save($contact, true); // true = ignore addressbook acl } // save primary group if necessary if ($data['account_primary_group'] && (!($memberships = $this->memberships($id,true)) ||