diff --git a/src/CommonITILObject.php b/src/CommonITILObject.php index bda8042b73f..a92ba15df3f 100644 --- a/src/CommonITILObject.php +++ b/src/CommonITILObject.php @@ -382,6 +382,18 @@ public function getActorsForType(int $actortype = 1, array $params = []): array ]); } } + + $groups_id = array_key_exists('_groups_id_' . $actortypestring, $params) && $params['_groups_id_' . $actortypestring] > 0 + ? $params['_groups_id_' . $actortypestring] : 0; + if ($groups_id > 0) { + $group_obj = new Group(); + if ($group_obj->getFromDB($groups_id)) { + $fn_add_actor('Group', $groups_id, [ + 'text' => $group_obj->getName(), + 'title' => $group_obj->getRawCompleteName(), + ]); + } + } } // load default actors from itiltemplate passed from showForm in `params` var diff --git a/src/Ticket.php b/src/Ticket.php index 138f69339a7..ff738da987a 100644 --- a/src/Ticket.php +++ b/src/Ticket.php @@ -4301,8 +4301,6 @@ public function showForm($ID, array $options = []) $options['entities_id'] = $item->fields['entities_id']; } - $initial_creation = static::isNewID($ID) && !$this->hasSavedInput(); - $this->restoreInputAndDefaults($ID, $options, null, true); if (isset($options['content'])) { @@ -4320,7 +4318,7 @@ public function showForm($ID, array $options = []) $options['_skip_promoted_fields'] = false; } - if ($initial_creation) { + if (static::isNewID($ID)) { // Override some values only for the initial load of a new ticket // Override defaut values from projecttask if needed if (isset($options['_projecttasks_id'])) {