From 94f500f020be7a2b081d8efe86ecfc908bf43b26 Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 14 Mar 2025 08:25:36 +0000 Subject: [PATCH] * [bug] Get chapter and docs. --- module/doc/control.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 739c05b18f..e6d544776c 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1941,7 +1941,9 @@ class doc extends control if($modalType == 'subDoc') $title = $this->lang->doc->addSubDoc; if($modalType == 'chapter') $title = $isCreate ? $this->lang->doc->addChapter : $this->lang->doc->editChapter; - if($modalType == 'chapter' || $modalType == 'subDoc' || $parentID) + + if($docID) $doc = $this->doc->getByID($docID); + if($modalType == 'chapter' || $modalType == 'subDoc' || $parentID || (isset($doc) && $doc->parent)) { $chapterAndDocs = $this->doc->getDocsOfLibs(array($libID), $objectType); $chapterAndDocs = array_column($chapterAndDocs, 'title', 'id'); @@ -1971,7 +1973,6 @@ class doc extends control } else { - $doc = $this->doc->getByID($docID); $moduleID = (int)$doc->module; $libID = (int)$doc->lib; $lib = $this->doc->getLibByID($libID);