mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix missing category list if main board has no categories but included boards have categories #2437
This commit is contained in:
parent
7539d18c60
commit
33c1d9a117
1 changed files with 22 additions and 4 deletions
|
|
@ -221,9 +221,10 @@ class BoardView extends Board
|
|||
/**
|
||||
* @brief display the category list
|
||||
**/
|
||||
function dispBoardCategoryList(){
|
||||
public function dispBoardCategoryList()
|
||||
{
|
||||
// check if the use_category option is enabled
|
||||
if($this->module_info->use_category=='Y')
|
||||
if ($this->module_info->use_category === 'Y' || !empty($this->include_modules))
|
||||
{
|
||||
// check the grant
|
||||
if(!$this->grant->list)
|
||||
|
|
@ -239,14 +240,31 @@ class BoardView extends Board
|
|||
}
|
||||
else
|
||||
{
|
||||
$category_list = DocumentModel::getCategoryList($this->module_srl);
|
||||
if ($this->module_info->use_category === 'Y')
|
||||
{
|
||||
$category_list = DocumentModel::getCategoryList($this->module_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$category_list = [];
|
||||
}
|
||||
|
||||
foreach ($this->include_modules as $module_srl)
|
||||
{
|
||||
if ($module_srl != $this->module_srl)
|
||||
{
|
||||
$category_list += DocumentModel::getCategoryList($module_srl);
|
||||
if ((ModuleModel::getModuleExtraVars($module_srl)->hide_category ?? 'N') !== 'Y')
|
||||
{
|
||||
$category_list += DocumentModel::getCategoryList($module_srl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($category_list)
|
||||
{
|
||||
$this->module_info->hide_category = 'N';
|
||||
$this->module_info->use_category = 'Y';
|
||||
}
|
||||
}
|
||||
Context::set('category_list', $category_list);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue