From c6fa8c42fa5ebdd61a1249ff34f0d7bb29a4fe2f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 Dec 2024 14:35:18 +0800 Subject: [PATCH] * [refac bug #58405] Check project var empty or not. --- module/execution/control.php | 2 +- module/execution/ui/create.field.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 84ad1e10df..826e1d126d 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1056,7 +1056,7 @@ class execution extends control $this->executionZen->setCopyProjects($project); $isStage = isset($output['type']) && $output['type'] == 'stage'; - if($project->model == 'waterfall' || $project->model == 'waterfallplus') + if($project && ($project->model == 'waterfall' || $project->model == 'waterfallplus')) { $this->view->parentStage = 0; $this->view->parentStages = $this->loadModel('programplan')->getParentStageList($projectID, 0, 0, 'withparent|noclosed|' . ($isStage ? 'stage' : 'notstage')); diff --git a/module/execution/ui/create.field.php b/module/execution/ui/create.field.php index 08637f7daa..d30b66e978 100644 --- a/module/execution/ui/create.field.php +++ b/module/execution/ui/create.field.php @@ -20,7 +20,7 @@ $fields->field('project') ->items(data('allProjects')) ->value(data('projectID')); -if($project->model == 'waterfall' || $project->model == 'waterfallplus') +if($project && ($project->model == 'waterfall' || $project->model == 'waterfallplus')) { $fields->field('parent') ->wrapBefore(true)