Skip to content

Commit

Permalink
fix: add ticket content from promoted followup
Browse files Browse the repository at this point in the history
  • Loading branch information
MyvTsv committed Mar 6, 2025
1 parent acadf92 commit 4faf9f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/CommonITILObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -4301,8 +4301,6 @@ public function showForm($ID, array $options = [])
$options['entities_id'] = $item->fields['entities_id'];
}

$is_promoted = static::isNewID($ID) && $this->hasSavedInput();

$this->restoreInputAndDefaults($ID, $options, null, true);

if (isset($options['content'])) {
Expand All @@ -4320,7 +4318,7 @@ public function showForm($ID, array $options = [])
$options['_skip_promoted_fields'] = false;
}

if ($is_promoted) {
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'])) {
Expand Down

0 comments on commit 4faf9f2

Please sign in to comment.