diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php
index 5c9c2f0f6f..068c1ada4f 100644
--- a/module/story/view/header.html.php
+++ b/module/story/view/header.html.php
@@ -28,8 +28,6 @@ function loadProduct(productID)
oldProductID = $('#product').val();
loadProductBranches(productID)
- loadProductModules(productID);
- loadProductPlans(productID);
}
function loadBranch()
@@ -44,7 +42,7 @@ function loadProductBranches(productID)
{
$('#branch').remove();
$('#branch_chosen').remove();
- $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data)
+ $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + "&oldBranch=0¶m=&projectID=" + executionID), function(data)
{
var $product = $('#product');
var $inputGroup = $product.closest('.input-group');
@@ -55,12 +53,15 @@ function loadProductBranches(productID)
$('#branch').css('width', config.currentMethod == 'create' ? '120px' : '65px').chosen();
}
$inputGroup.fixInputGroup();
+
+ loadProductModules(productID, $('#branch').val());
+ loadProductPlans(productID, $('#branch').val());
})
}
function loadProductModules(productID, branch)
{
- if(typeof(branch) == 'undefined') branch = 0;
+ if(typeof(branch) == 'undefined') branch = $('#branch').val();
if(!branch) branch = 0;
var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
var $moduleIDBox = $('#moduleIdBox');