From 11fa48108ffc5ef7b276f7261b29eaca406105b8 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 17 Dec 2014 10:58:43 -0800 Subject: [PATCH] CLOUDSTACK-8075: UI > Instances menu > Add Instance > Select template/ISO > "shared" tab > select a shared template, click Next button => fix error "unable to find matched template object". --- ui/scripts/instanceWizard.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index a067d7d7a69..984c6e3dee1 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -323,11 +323,22 @@ } } } - } - if (selectedTemplateObj == null) + } + if (selectedTemplateObj == null) { + if (sharedTemplateObjs != null && sharedTemplateObjs.length > 0) { + for (var i = 0; i < sharedTemplateObjs.length; i++) { + if (sharedTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = sharedTemplateObjs[i]; + break; + } + } + } + } + if (selectedTemplateObj == null) { alert("unable to find matched template object"); - else + } else { selectedHypervisor = selectedTemplateObj.hypervisor; + } } else { //(args.currentData["select-template"] == "select-iso" selectedHypervisor = args.currentData.hypervisorid; }