From 45a62a3b5d2b2589944c1c19163bc2b9ed31a1af Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 10 Oct 2019 16:03:55 +0200 Subject: [PATCH] Make sure we have lid for hook even if not changed, some backend require it --- admin/inc/class.admin_cmd_edit_group.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.admin_cmd_edit_group.inc.php b/admin/inc/class.admin_cmd_edit_group.inc.php index fbe3903337..c2eb6abc11 100644 --- a/admin/inc/class.admin_cmd_edit_group.inc.php +++ b/admin/inc/class.admin_cmd_edit_group.inc.php @@ -94,15 +94,18 @@ class admin_cmd_edit_group extends admin_cmd if (is_null($value)) $value = $old[$name]; } } + // Make sure we have lid for hook even if not changed, some backend require it + if (empty($data['account_lid'])) + { + $data['account_lid'] = admin_cmd::$accounts->id2name($data['account_id']); + } if (!($data['account_id'] = admin_cmd::$accounts->save($data))) { //_debug_array($data); throw new Api\Db\Exception(lang("Error saving account!"),11); } - // Make sure we have lid for hook even if not changed, also set deprecated name - $data['account_name'] = $data['account_lid'] = $data['account_lid'] ? - $data['account_lid'] : - admin_cmd::$accounts->id2name($data['account_id']); + // set deprecated name + $data['account_name'] = $data['account_lid']; if ($update) $data['old_name'] = $old['account_lid']; // make old name available for hooks $GLOBALS['hook_values'] =& $data;