From ba40b51aaa5b4eb01c1cbadf9741bdddf012df17 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 21 Feb 2024 17:09:30 +0800 Subject: [PATCH] * Fix execution indentation when the parent does not exist. bug #42233. --- module/execution/model.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 34a3035e95..aed876ed46 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4699,14 +4699,17 @@ class executionModel extends model { $rows = array(); $this->app->loadConfig('project'); - foreach($executions as $execution) + + $executionList = array(); + foreach($executions as $execution) $executionList[$execution->id] = $execution; + foreach($executionList as $execution) { $execution->rawID = $execution->id; $execution->isExecution = 1; $execution->id = 'pid' . (string)$execution->id; $execution->projectID = $execution->project; $execution->project = $execution->projectName; - $execution->parent = ($execution->parent && $execution->grade > 1) ? 'pid' . (string)$execution->parent : ''; + $execution->parent = (isset($executionList[$execution->parent]) && $execution->parent && $execution->grade > 1) ? 'pid' . (string)$execution->parent : ''; $execution->isParent = !empty($execution->isParent) or !empty($execution->tasks); $execution->actions = array(); if(isset($this->config->projectExecution->dtable->actionsRule[$execution->projectModel]))