Skip to content

Commit

Permalink
refactor(issue): simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Mar 29, 2022
1 parent a8580a7 commit 0a912eb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,7 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
'ORDER' => ['id'],
'LIMIT' => '1',
])->next();
if ($requester === null) {
$requester = [
'users_id' => 0,
];
}
$requester = $requester['users_id'] ?? 0;

$issue->update([
'id' => $issue->getID(),
Expand All @@ -405,7 +401,7 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
'date_mod' => $item->fields['date_mod'],
'entities_id' => $item->fields['entities_id'],
'is_recursive' => '0',
'requester_id' => $requester['users_id'],
'requester_id' => $requester,
'users_id_validator' => $validationStatus['user'],
'comment' => addslashes($item->fields['content']),
]);
Expand Down

0 comments on commit 0a912eb

Please sign in to comment.