summaryrefslogtreecommitdiff
path: root/app/Model/ActionParameterModel.php
diff options
context:
space:
mode:
authorrafacamargo123 <rafacamargo123@gmail.com>2018-12-27 17:44:49 -0200
committerfguillot <fred@kanboard.net>2018-12-27 11:44:49 -0800
commit30e9c221399c80696d6e317af1470868589dcd13 (patch)
treea61b35d8cf0dc8ae210537c83faceca4645eae9b /app/Model/ActionParameterModel.php
parent44c69863ebaf107ba3eeec4dbdba015829e453cb (diff)
Fix import of automatic actions when parameters are "unassigned" or "no category"
Diffstat (limited to 'app/Model/ActionParameterModel.php')
-rw-r--r--app/Model/ActionParameterModel.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Model/ActionParameterModel.php b/app/Model/ActionParameterModel.php
index cdac396e..66c7adb4 100644
--- a/app/Model/ActionParameterModel.php
+++ b/app/Model/ActionParameterModel.php
@@ -147,6 +147,9 @@ class ActionParameterModel extends Base
case 'project_id':
return $value != $project_id ? $value : false;
case 'category_id':
+ if ($value == 0) {
+ return 0;
+ }
return $this->categoryModel->getIdByName($project_id, $this->categoryModel->getNameById($value)) ?: false;
case 'src_column_id':
case 'dest_column_id':
@@ -156,6 +159,9 @@ class ActionParameterModel extends Base
return empty($column) ? false : $this->columnModel->getColumnIdByTitle($project_id, $column['title']) ?: false;
case 'user_id':
case 'owner_id':
+ if ($value == 0) {
+ return 0;
+ }
return $this->projectPermissionModel->isAssignable($project_id, $value) ? $value : false;
case 'swimlane_id':
$column = $this->swimlaneModel->getById($value);