From 2a7b4be713f1da9f04eedf302c1f11968fa2fb04 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 17 Dec 2016 00:03:00 +0900 Subject: [PATCH] Fix #631 error when no category is granted to current user --- modules/board/board.view.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index b64f55926..a7c6fb323 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -673,6 +673,7 @@ class boardView extends board $group_srls_count = count($group_srls); // check the grant after obtained the category list + $category_list = array(); $normal_category_list = $oDocumentModel->getCategoryList($this->module_srl); if(count($normal_category_list)) { @@ -689,7 +690,24 @@ class boardView extends board if($is_granted) $category_list[$category_srl] = $category; } } - Context::set('category_list', $category_list); + + // check if at least one category is granted + $grant_exists = false; + foreach ($category_list as $category) + { + if ($category->grant) + { + $grant_exists = true; + } + } + if ($grant_exists) + { + Context::set('category_list', $category_list); + } + else + { + Context::set('category_list', array()); + } } // GET parameter document_srl from request