From 7cc2dbec7f40e987966edcd737b9fc801e3c702c Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 28 Apr 2025 14:06:49 +0800 Subject: [PATCH] * [bug#61891] Set module name for template list. --- module/doc/model.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 10ac1ca257..84990bae3a 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1194,8 +1194,23 @@ class docModel extends model $doc->productName = $doc->executionName = $doc->moduleName = ''; if($doc->product) $doc->productName = $this->dao->findByID($doc->product)->from(TABLE_PRODUCT)->fetch('name'); if($doc->execution) $doc->executionName = $this->dao->findByID($doc->execution)->from(TABLE_EXECUTION)->fetch('name'); - if($doc->module) $doc->moduleName = $this->dao->findByID($doc->module)->from(TABLE_MODULE)->fetch('name'); - if(!$doc->module && $doc->type == 'article' && $doc->parent) $doc->moduleName = $this->dao->findByID($doc->parent)->from(TABLE_DOC)->fetch('title'); + if($doc->module) + { + if($doc->type == 'article' && $doc->parent) + { + $doc->moduleName = $this->dao->findByID($doc->parent)->from(TABLE_DOC)->fetch('title'); + } + elseif(!empty($doc->templateType)) + { + $modules = $this->getTemplateModules(); + $modules = array_column($modules, 'fullName', 'id'); + $doc->moduleName = zget($modules, $doc->module); + } + else + { + $doc->moduleName = $this->dao->findByID($doc->module)->from(TABLE_MODULE)->fetch('name'); + } + } return $doc; } @@ -4084,7 +4099,7 @@ class docModel extends model if(!isset($modules[$id])) continue; $names[] = $modules[$id]->name; } - $module->fullName = implode(' / ', $names); + $module->fullName = implode('/', $names); } return array_values($modules);