Skip to content

Commit 3480990

Browse files
author
Nuo Yan
committed
CHEF-2039 Not displaying empty array as a cookbook name in the drop down menu on the environment create/edit form
1 parent b657ba9 commit 3480990

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎chef-server-webui/public/javascripts/cookbook_constraint_ctrl.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ function retrieveCbName(timestamp){
5959
function addTableRow(default_cookbook, default_operator, default_version){
6060
var cookbook_names_string = document.getElementById('cbVerPickerTable').getAttribute('data-cookbook_names');
6161
var cookbook_names = cookbook_names_string.substring(2, cookbook_names_string.length-2).split('","');
62+
if (cookbook_names[0] == "[]")
63+
cookbook_names = [];
6264
var timestamp = new Date().getTime();
6365
var row = '<tr id=' + '"' + timestamp + '"><td>' + '<select size="1" name="cookbook_name_' + timestamp + '" ' + 'id="cookbook_name_' + timestamp + '" class="cookbook_version_constraints_cb_name" onchange="jQuerySuggest(' + timestamp + ')"'+'>'
6466
+ buildCookbookList(cookbook_names, default_cookbook) + '</select>'

0 commit comments

Comments
 (0)