From fb7a890ec70be9076b1f0eb3bf4e8494d6c66b3c Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 20 Nov 2023 11:00:16 +0800 Subject: [PATCH] * Jump to the error page if no products in testsuite. --- module/testsuite/control.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/testsuite/control.php b/module/testsuite/control.php index e84dbd2140..f03d845906 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -40,7 +40,12 @@ class testsuite extends control parent::__construct($moduleName, $methodName); $this->view->products = $this->products = $this->loadModel('product')->getPairs('', 0, '', 'all'); - if(empty($this->products) && !helper::isAjaxRequest()) return $this->send(array('result' => 'fail', 'open' => $this->createLink('product', 'showErrorNone', 'moduleName=qa&activeMenu=testsuite'))); + if(empty($products) && (helper::isAjaxRequest('zin') || helper::isAjaxRequest('fetch'))) + { + $tab = $this->app->tab == 'project' || $this->app->tab == 'execution' ? $this->app->tab : 'qa'; + $objectID = $tab == 'project' || $tab == 'execution' ? $this->session->{$tab} : 0; + $this->locate($this->createLink('product', 'showErrorNone', "moduleName={$tab}&activeMenu=testsuite&objectID=$objectID")); + } } /**