From 723ef6e49552f7407194b701927a0b2a167a4ced Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 18 Sep 2013 16:43:18 -0700 Subject: [PATCH] CLOUDSTACK-4702: UI > Network menu > Add Guest Network dialog > UI shouldn't pass null zoneid to listnetworkofferings API when zone dropdown is empty (i.e. when no advanced zone exists). --- ui/scripts/sharedFunctions.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index b6a1c1fbf77..1596973bd30 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -450,7 +450,14 @@ var addGuestNetworkDialog = { label: 'label.network.offering', docID: 'helpGuestNetworkZoneNetworkOffering', dependsOn: ['zoneId', 'scope'], - select: function(args) { + select: function(args) { + if(args.$form.find('.form-item[rel=zoneId]').find('select').val() == null || args.$form.find('.form-item[rel=zoneId]').find('select').val().length == 0) { + args.response.success({ + data: null + }); + return; + } + var data = { state: 'Enabled', zoneid: args.$form.find('.form-item[rel=zoneId]').find('select').val()