From 937079709514c037959d691c0d653c39d5ea84e6 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 20:26:23 -0400 Subject: Minor fixes --- app/Controller/CategoryController.php | 2 +- app/Controller/ColumnController.php | 2 +- app/Controller/CommentController.php | 2 +- app/Controller/CustomFilterController.php | 9 ++++++++- app/Controller/SubtaskController.php | 2 +- app/Controller/SwimlaneController.php | 2 +- app/Controller/TaskExternalLinkController.php | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) (limited to 'app/Controller') diff --git a/app/Controller/CategoryController.php b/app/Controller/CategoryController.php index fd1b3f94..dd6e1c35 100644 --- a/app/Controller/CategoryController.php +++ b/app/Controller/CategoryController.php @@ -64,7 +64,7 @@ class CategoryController extends BaseController list($valid, $errors) = $this->categoryValidator->validateCreation($values); if ($valid) { - if ($this->categoryModel->create($values)) { + if ($this->categoryModel->create($values) !== false) { $this->flash->success(t('Your category have been created successfully.')); return $this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id']))); } else { diff --git a/app/Controller/ColumnController.php b/app/Controller/ColumnController.php index 8bf3d562..95fbcaaa 100644 --- a/app/Controller/ColumnController.php +++ b/app/Controller/ColumnController.php @@ -66,7 +66,7 @@ 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'])) { + if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description']) !== 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 { diff --git a/app/Controller/CommentController.php b/app/Controller/CommentController.php index 696d240f..2a8c258a 100644 --- a/app/Controller/CommentController.php +++ b/app/Controller/CommentController.php @@ -76,7 +76,7 @@ class CommentController extends BaseController list($valid, $errors) = $this->commentValidator->validateCreation($values); if ($valid) { - if ($this->commentModel->create($values)) { + if ($this->commentModel->create($values) !== false) { $this->flash->success(t('Comment added successfully.')); } else { $this->flash->failure(t('Unable to create your comment.')); diff --git a/app/Controller/CustomFilterController.php b/app/Controller/CustomFilterController.php index 8bba0856..e5f674cd 100644 --- a/app/Controller/CustomFilterController.php +++ b/app/Controller/CustomFilterController.php @@ -18,6 +18,9 @@ class CustomFilterController extends BaseController * Display list of filters * * @access public + * @param array $values + * @param array $errors + * @throws \Kanboard\Core\Controller\PageNotFoundException */ public function index(array $values = array(), array $errors = array()) { @@ -47,7 +50,7 @@ class CustomFilterController extends BaseController list($valid, $errors) = $this->customFilterValidator->validateCreation($values); if ($valid) { - if ($this->customFilterModel->create($values)) { + if ($this->customFilterModel->create($values) !== false) { $this->flash->success(t('Your custom filter have been created successfully.')); return $this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id']))); } else { @@ -101,6 +104,10 @@ class CustomFilterController extends BaseController * Edit a custom filter (display the form) * * @access public + * @param array $values + * @param array $errors + * @throws AccessForbiddenException + * @throws \Kanboard\Core\Controller\PageNotFoundException */ public function edit(array $values = array(), array $errors = array()) { diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index 46061122..93dab5cd 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -54,7 +54,7 @@ class SubtaskController extends BaseController list($valid, $errors) = $this->subtaskValidator->validateCreation($values); if ($valid) { - if ($this->subtaskModel->create($values)) { + if ($this->subtaskModel->create($values) !== false) { $this->flash->success(t('Sub-task added successfully.')); } else { $this->flash->failure(t('Unable to create your sub-task.')); diff --git a/app/Controller/SwimlaneController.php b/app/Controller/SwimlaneController.php index 4b9567e6..c7c20ce8 100644 --- a/app/Controller/SwimlaneController.php +++ b/app/Controller/SwimlaneController.php @@ -81,7 +81,7 @@ class SwimlaneController extends BaseController list($valid, $errors) = $this->swimlaneValidator->validateCreation($values); if ($valid) { - if ($this->swimlaneModel->create($values)) { + if ($this->swimlaneModel->create($values) !== false) { $this->flash->success(t('Your swimlane have been created successfully.')); return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); } else { diff --git a/app/Controller/TaskExternalLinkController.php b/app/Controller/TaskExternalLinkController.php index f3c6050d..9c04eb00 100644 --- a/app/Controller/TaskExternalLinkController.php +++ b/app/Controller/TaskExternalLinkController.php @@ -76,7 +76,7 @@ class TaskExternalLinkController extends BaseController $values = $this->request->getValues(); list($valid, $errors) = $this->externalLinkValidator->validateCreation($values); - if ($valid && $this->taskExternalLinkModel->create($values)) { + if ($valid && $this->taskExternalLinkModel->create($values) !== false) { $this->flash->success(t('Link added successfully.')); return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); } -- cgit v1.2.3