diff --git a/module/execution/control.php b/module/execution/control.php index bc83baa8e5..aafef71e9f 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -145,8 +145,8 @@ class execution extends control if($browseType == 'byproduct') $productID = (int)$param; if(!in_array($browseType, array('bysearch', 'bymodule', 'byproduct'))) { - $moduleID = $this->cookie->moduleBrowseParam; - $productID = $this->cookie->productBrowseParam; + $moduleID = $this->cookie->moduleBrowseParam ? $this->cookie->moduleBrowseParam : 0; + $productID = $this->cookie->productBrowseParam ? $this->cookie->productBrowseParam : 0; } /* Load pager and get tasks. */ diff --git a/module/tree/model.php b/module/tree/model.php index d068f6ebea..341d6d972f 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -169,7 +169,7 @@ class treeModel extends model if($product and $product->type != 'normal') { $branchPairs = $this->loadModel('branch')->getPairs($rootID, 'all'); - foreach(explode(',', $branch) as $branchID) $branches[$branchID] = $branchPairs[$branchID]; + foreach(explode(',', (string)$branch) as $branchID) $branches[$branchID] = $branchPairs[$branchID]; } } @@ -179,7 +179,7 @@ class treeModel extends model $treeMenu = array(); foreach($branches as $branchID => $branch) { - $stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param)); + $stmt = $this->app->dbQuery($this->buildMenuQuery($rootID, $type, $startModule, (string)$branchID, $param)); $modules = array(); while($module = $stmt->fetch()) { @@ -1266,12 +1266,12 @@ class treeModel extends model * * @param string $type * @param object $module - * @param string $parent + * @param int $parent * @param array $extra * @access public * @return object */ - public function createBugLink(string $type, object $module, string $parent, array $extra = array()): object + public function createBugLink(string $type, object $module, int $parent, array $extra = array()): object { $moduleName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'bug'; $methodName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? 'bug' : 'browse'; @@ -1299,12 +1299,12 @@ class treeModel extends model * * @param string $type * @param object $module - * @param string $parent + * @param int $parent * @param array|string $extra * @access public * @return object */ - public function createCaseLink(string $type, object $module, string $parent, array|string $extra = array()): object + public function createCaseLink(string $type, object $module, int $parent, array|string $extra = array()): object { $moduleName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'testcase'; $methodName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? 'testcase' : 'browse';