Skip to content
Snippets Groups Projects
Commit 84c84d44 authored by Jared Hancock's avatar Jared Hancock
Browse files

filter: Fix recursion crash updating filter with set-dept action

parent ed966c7b
No related branches found
No related tags found
No related merge requests found
......@@ -288,10 +288,9 @@ class FA_RouteDepartment extends TriggerAction {
),
'choices' =>
Dept::getDepartments() +
array(':new:' => '— '.__('Add New').' —')
,
'validators' => function($self) {
if ($self->getClean() === ':new:')
array(':new:' => '— '.__('Add New').' —'),
'validators' => function($self, $clean) {
if ($clean === ':new:')
$self->addError(__('Select a department'));
}
)),
......@@ -368,12 +367,11 @@ class FA_AssignTeam extends TriggerAction {
'prompt' => __('Unchanged'),
'data' => array('quick-add' => 'team'),
),
'choices' => array_merge(
$choices,
array(':new:' => '— '.__('Add New').' —')
),
'validators' => function($self) {
if ($self->getClean() === ':new:')
'choices' =>
Team::getTeams() +
array(':new:' => '— '.__('Add New').' —'),
'validators' => function($self, $clean) {
if ($clean === ':new:')
$self->addError(__('Select a team'));
}
)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment