Bug 14981: cloudstack UI - update Host - OS Category dropdown - assign empty string instead of null as id to blank option. When Apply button is clicked, check whether the option id is empty string instead of English word 'None' which doesn't work for non-English environment.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6ad1ed05 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6ad1ed05 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6ad1ed05 Branch: refs/heads/marvin-parallel Commit: 6ad1ed05e3fa623f0a5ad94091b0bfc99aa534a2 Parents: 7ed6096 Author: Jessica Wang <[email protected]> Authored: Wed Oct 24 14:01:13 2012 -0700 Committer: Jessica Wang <[email protected]> Committed: Wed Oct 24 14:18:05 2012 -0700 ---------------------------------------------------------------------- ui/scripts/system.js | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6ad1ed05/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index ef18601..4eadf09 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -8208,7 +8208,7 @@ var array1 = []; array1.push("&hosttags=" + todb(args.data.hosttags)); - if (args.data.oscategoryid != null) + if (args.data.oscategoryid != null && args.data.oscategoryid.length > 0) array1.push("&osCategoryId=" + args.data.oscategoryid); $.ajax({ @@ -8425,13 +8425,12 @@ async: true, success: function(json) { var oscategoryObjs = json.listoscategoriesresponse.oscategory; - var items = []; + var items = [ + { id: '', description: _l('label.none') } + ]; $(oscategoryObjs).each(function() { - if(this.name == 'None') - items.unshift({ id: this.id, description: _l('label.none') }); - else - items.push({id: this.id, description: this.name}); - }); + items.push({id: this.id, description: this.name}); + }); args.response.success({data: items}); } });
