mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix #631 error when no category is granted to current user
This commit is contained in:
parent
c900f49d72
commit
2a7b4be713
1 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue