diff --git a/module/story/control.php b/module/story/control.php index 78353e4e8a..8018c60fe3 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -56,6 +56,7 @@ class story extends control $copyStoryID = $storyID; list($productID, $objectID) = $this->storyZen->setMenuForCreate($productID, $objectID); if($productID == 0 && $objectID == 0) return $this->locate($this->createLink('product', 'create')); + if($productID == 0 && $objectID != 0) return $this->sendError($this->lang->execution->errorNoLinkedProducts, $this->createLink('execution', 'manageproducts', "executionID=$objectID")); if(!empty($_POST)) { @@ -167,6 +168,8 @@ class story extends control $this->storyZen->setMenuForBatchCreate($productID, $branch, $executionID, $extra); + if($productID == 0 && $executionID != 0) return $this->sendError($this->lang->execution->errorNoLinkedProducts, $this->createLink('execution', 'manageproducts', "executionID=$executionID")); + /* Check can subdivide or not. */ $product = $this->product->getByID($productID); if($product) $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);