diff --git a/module/story/model.php b/module/story/model.php index 3700c1a3cf..867051661d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -916,6 +916,14 @@ class storyModel extends model } } + /*Fix product changes when editing requirements on site */ + $storyProjectID = $this->dao->select('t2.hasProduct')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.product')->eq($oldStory->product) + ->andWhere('t2.deleted')->eq(0) + ->fetch(); + $_POST['product'] = !$storyProjectID->hasProduct ? $oldStory->product : $this->post->product; + $story = fixer::input('post') ->cleanInt('product,module,pri,duplicateStory') ->cleanFloat('estimate') diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 306faaa467..477eb95c91 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -337,6 +337,7 @@ class testsuite extends control /* Build the search form. */ $this->loadModel('testcase'); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case', 0, 'all'); + $this->config->testcase->search['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries(); $this->config->testcase->search['module'] = 'testsuite'; $this->config->testcase->search['actionURL'] = inlink('linkCase', "suiteID=$suiteID¶m=myQueryID"); unset($this->config->testcase->search['fields']['product']);