diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-09 14:51:39 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-09 14:51:39 -0400 |
commit | 397988dd8ddeefa57da085c7cc5ac9231c33370b (patch) | |
tree | d4391bdcf5e026191cc4817cbb8d772be1c652cf /app/Controller/ColumnController.php | |
parent | 141939b703b4028fb85c04ba5d27445486eceb61 (diff) |
Fix a couple of bugs in PR #2424
Diffstat (limited to 'app/Controller/ColumnController.php')
-rw-r--r-- | app/Controller/ColumnController.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/app/Controller/ColumnController.php b/app/Controller/ColumnController.php index e3f9bfff..d3f0e36e 100644 --- a/app/Controller/ColumnController.php +++ b/app/Controller/ColumnController.php @@ -66,7 +66,15 @@ class ColumnController extends BaseController list($valid, $errors) = $this->columnValidator->validateCreation($values); if ($valid) { - if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description'], $values['hide_in_dashboard']) !== false) { + $result = $this->columnModel->create( + $project['id'], + $values['title'], + $values['task_limit'], + $values['description'], + isset($values['hide_in_dashboard']) ? $values['hide_in_dashboard'] : 0 + ); + + if ($result !== false) { $this->flash->success(t('Column created successfully.')); return $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])), true); } else { @@ -111,7 +119,15 @@ class ColumnController extends BaseController list($valid, $errors) = $this->columnValidator->validateModification($values); if ($valid) { - if ($this->columnModel->update($values['id'], $values['title'], $values['task_limit'], $values['description'], $values['hide_in_dashboard']) !== false) { + $result = $this->columnModel->update( + $values['id'], + $values['title'], + $values['task_limit'], + $values['description'], + isset($values['hide_in_dashboard']) ? $values['hide_in_dashboard'] : 0 + ); + + if ($result) { $this->flash->success(t('Board updated successfully.')); return $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id']))); } else { |