diff --git a/module/testcase/ui/browse.html.php b/module/testcase/ui/browse.html.php
index fc89639026..16e4e9b70c 100644
--- a/module/testcase/ui/browse.html.php
+++ b/module/testcase/ui/browse.html.php
@@ -20,7 +20,7 @@ $canBatchReview = hasPriv('testcase', 'batchReview') && !$isOnlyScen
$canBatchDelete = hasPriv('testcase', 'batchDelete') && !$isOnlyScene;
$canBatchChangeType = hasPriv('testcase', 'batchChangeType') && !$isOnlyScene;
$canBatchConfirmStoryChange = hasPriv('testcase', 'batchConfirmStoryChange') && !$isOnlyScene;
-$canBatchChangeBranch = hasPriv('testcase', 'batchChangeBranch') && !$isOnlyScene && $this->session->currentProductType && $this->session->currentProductType != 'normal';
+$canBatchChangeBranch = hasPriv('testcase', 'batchChangeBranch') && !$isOnlyScene && $product->type != 'normal';
$canBatchChangeModule = hasPriv('testcase', 'batchChangeModule') && !empty($productID) && ($product->type == 'normal' || $branch !== 'all');
$canBatchChangeScene = hasPriv('testcase', 'batchChangeScene') && !$isOnlyScene;
$canImportToLib = hasPriv('testcase', 'importToLib') && !$isOnlyScene;
@@ -83,7 +83,7 @@ $footToolbar = $canBatchAction ? array('items' => array
$canBatchEdit ? array('text' => $lang->edit, 'className' => 'batch-btn secondary not-open-url', 'data-url' => helper::createLink('testcase', 'batchEdit', "productID=$caseProductID&branch=$branch")) : null,
!empty($navActions) ? array('caret' => 'up', 'className' => 'secondary', 'items' => $navActions, 'data-placement' => 'top-start') : null,
)) : null,
- $canBatchChangeBranch ? array('caret' => 'up', 'text' => $lang->product->branchName[$this->session->currentProductType], 'type' => 'dropdown', 'items' => $branchItems, 'data-placement' => 'top-start') : null,
+ $canBatchChangeBranch ? array('caret' => 'up', 'text' => $lang->product->branchName[$product->type], 'type' => 'dropdown', 'items' => $branchItems, 'data-placement' => 'top-start') : null,
$canBatchChangeModule ? array('caret' => 'up', 'text' => $lang->testcase->moduleAB, 'type' => 'dropdown', 'items' => $moduleItems, 'data-placement' => 'top-start') : null,
$canBatchChangeScene ? array('caret' => 'up', 'text' => $lang->testcase->scene, 'type' => 'dropdown', 'items' => $sceneItems, 'data-placement' => 'top-start') : null,
$canImportToLib ? array('text' => $lang->testcase->importToLib, 'data-toggle' => 'modal', 'data-target' => '#importToLib', 'data-size' => 'sm') : null,
diff --git a/module/testcase/zen.php b/module/testcase/zen.php
index 381a88ef03..682ecf0a4c 100644
--- a/module/testcase/zen.php
+++ b/module/testcase/zen.php
@@ -2365,7 +2365,8 @@ class testcaseZen extends testcase
$this->config->testcase->search['params']['scene']['values'] = $this->testcase->getSceneMenu($productID, $moduleID, $branch, 0, 0, true);
$this->config->testcase->search['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries();
- if($this->session->currentProductType == 'normal' || $this->app->tab == 'project')
+ $product = $this->loadModel('product')->fetchByID($productID);
+ if($product->type == 'normal' || $this->app->tab == 'project')
{
unset($this->config->testcase->search['fields']['branch']);
unset($this->config->testcase->search['params']['branch']);
@@ -2373,7 +2374,6 @@ class testcaseZen extends testcase
else
{
$this->app->loadLang('branch');
- $product = $this->loadModel('product')->getByID($productID);
$branches = $this->loadModel('branch')->getPairs($productID, '', $projectID);
$branches = array('') + array('0' => $this->lang->branch->main) + $branches + array('all' => $this->lang->branch->all);