diff options
author | Rafael de Camargo <rafaelcamargo@trt15.jus.br> | 2019-07-23 17:18:42 -0300 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2019-07-23 15:41:13 -0700 |
commit | e488fdd154cd6c7f03d969a43c1a987c5345101b (patch) | |
tree | 902918aad69243b8092e41f439e86f633f55f883 /app/Model | |
parent | 21a3634fd131a0f1d6128c27ea6c582661a863f0 (diff) |
Implements check for duplicate default columns
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/BoardModel.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/app/Model/BoardModel.php b/app/Model/BoardModel.php index f83b7cc2..ad590ff7 100644 --- a/app/Model/BoardModel.php +++ b/app/Model/BoardModel.php @@ -31,20 +31,16 @@ class BoardModel extends Base */ public function getUserColumns() { - $column_names = explode(',', $this->configModel->get('board_columns', implode(',', $this->getDefaultColumns()))); + $column_names = array_unique(explode_csv_field($this->configModel->get('board_columns', implode(',', $this->getDefaultColumns())))); $columns = array(); foreach ($column_names as $column_name) { - $column_name = trim($column_name); - - if (! empty($column_name)) { - $columns[] = array( - 'title' => $column_name, - 'task_limit' => 0, - 'description' => '', - 'hide_in_dashboard' => 0, - ); - } + $columns[] = array( + 'title' => $column_name, + 'task_limit' => 0, + 'description' => '', + 'hide_in_dashboard' => 0, + ); } return $columns; |