From 3d64493a751f2d9054e702b379ef7b210e1af70a Mon Sep 17 00:00:00 2001 From: liuruogu Date: Wed, 21 Sep 2022 06:38:43 +0000 Subject: [PATCH] * Fix bug #27665 and hidden product menu. --- module/execution/model.php | 2 ++ module/story/control.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/module/execution/model.php b/module/execution/model.php index 2b1ed450fc..27cf2f9a4f 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -120,6 +120,8 @@ class executionModel extends model $this->cookie->executionMode = 'all'; } + if(empty($execution->hasProduct)) unset($this->lang->execution->menu->settings['subMenu']->products); + $this->lang->switcherMenu = $this->getSwitcher($executionID, $this->app->rawModule, $this->app->rawMethod); common::setMenuVars('execution', $executionID); } diff --git a/module/story/control.php b/module/story/control.php index 618a9933c9..d42efc4f5c 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2229,6 +2229,7 @@ class story extends control $story = $this->story->getById($storyID); $products = $this->product->getPairs('', 0, '', true); $queryID = 0; + $product = $this->product->getByID($story->product); /* Change for requirement story title. */ if($story->type == 'story') @@ -2244,6 +2245,8 @@ class story extends control $this->lang->story->title = str_replace($this->lang->URCommon, $this->lang->SRCommon, $this->lang->story->title); } + if(!empty($product->shadow)) unset($this->config->product->search['fields']['product']); + /* Build search form. */ $actionURL = $this->createLink('story', 'linkStory', "storyID=$storyID&type=$type&linkedStoryID=$linkedStoryID&browseType=bySearch&queryID=myQueryID&storyType=$storyType", '', true); $this->product->buildSearchForm($story->product, $products, $queryID, $actionURL);