Skip to content

Commit

Permalink
Fix issue with assignee not populating when assignee group is selected
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Oct 5, 2023
1 parent 0fdd266 commit 3472490
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/admin/formwidgets/StatusEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,13 @@ public function onSaveRecord()
throw new ApplicationException(sprintf(lang('admin::lang.statuses.alert_already_added'), $context, $context));

$this->validateFormWidget($form, $saveData);
}
catch (ValidationException $ex) {
} catch (ValidationException $ex) {
throw new ApplicationException($ex->getMessage());
}

if ($this->saveRecord($saveData, $keyFrom)) {
flash()->success(sprintf(lang('admin::lang.alert_success'), lang($this->getModeConfig('formName')).' '.'updated'))->now();
}
else {
} else {
flash()->error(lang('admin::lang.alert_error_try_again'))->now();
}

Expand Down Expand Up @@ -207,7 +205,7 @@ public function onLoadAssigneeList()
$formField = $form->getField($this->assigneeKeyFrom);

return [
'#'.$formField->getId() => $form->renderField($formField, [
'#'.$formField->getId('group') => $form->renderField($formField, [
'useContainer' => false,
]),
];
Expand Down Expand Up @@ -335,8 +333,7 @@ protected function saveRecord(array $saveData, string $keyFrom)
$staff = Staffs_model::find(array_get($saveData, $keyFrom));
if ($record = $this->model->updateAssignTo($group, $staff))
AssigneeUpdated::log($record, $this->getController()->getUser());
}
else {
} else {
$status = Statuses_model::find(array_get($saveData, $keyFrom));
if ($record = $this->model->addStatusHistory($status, $saveData))
StatusUpdated::log($record, $this->getController()->getUser());
Expand Down

0 comments on commit 3472490

Please sign in to comment.