From ebec2246441ca72370719661dc28ec6a91fbe056 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Mon, 25 Dec 2023 09:14:09 +0800 Subject: [PATCH] * Fix bug #42203. --- module/release/model.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/release/model.php b/module/release/model.php index fe2111e8de..8cc4ff440e 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -184,6 +184,19 @@ class releaseModel extends model */ public function create($productID = 0, $branch = 0, $projectID = 0) { + if(empty($projectID)) + { + $product = $this->loadModel('product')->getById($productID); + if($product->shadow) + { + $projectID = $this->dao->select('t2.id')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2') + ->on('t1.project=t2.id') + ->where('t1.product')->eq($productID) + ->andWhere('t2.type')->eq('project') + ->fetch('id'); + } + } /* Init vars. */ $productID = $this->post->product ? $this->post->product : (int)$productID; $branch = $this->post->branch ? $this->post->branch : (int)$branch;