diff --git a/module/build/control.php b/module/build/control.php index f701326654..b570b1938f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -643,7 +643,10 @@ class build extends control if($build->branch) { - foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); + foreach(explode(',', $build->branch) as $branchID) + { + if(isset($branchPairs[$branchID])) $branches += array($branchID => $branchPairs[$branchID]); + } } $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); diff --git a/module/build/model.php b/module/build/model.php index e1718d1209..6e3f5ff96a 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -457,7 +457,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch']) and isset($_POST['product'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch);