From 4e0cd5a9650c5c067c3ae4246d9150092fc8eadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Mon, 23 Aug 2021 15:46:34 +0800 Subject: [PATCH] * fix bug #14540. --- module/program/control.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/program/control.php b/module/program/control.php index 0efabdc13c..c99086e534 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -174,7 +174,10 @@ class program extends control $program = $this->program->getByID($programID); $parentProgram = $program->parent ? $this->program->getByID($program->parent) : ''; $parents = $this->program->getParentPairs(); - unset($parents[$programID]); + + /* Remove children program from parents. */ + $children = $this->dao->select('*')->from(TABLE_PROGRAM)->where('path')->like("%,$programID,%")->fetchPairs('id', 'id'); + foreach($children as $childID) unset($parents[$childID]); $this->view->title = $this->lang->program->edit; $this->view->position[] = $this->lang->program->edit;