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".

This commit is contained in:
Jessica Wang 2014-12-17 10:58:43 -08:00
parent ed5bc1c7ea
commit 11fa48108f

View File

@ -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"); alert("unable to find matched template object");
else } else {
selectedHypervisor = selectedTemplateObj.hypervisor; selectedHypervisor = selectedTemplateObj.hypervisor;
}
} else { //(args.currentData["select-template"] == "select-iso" } else { //(args.currentData["select-template"] == "select-iso"
selectedHypervisor = args.currentData.hypervisorid; selectedHypervisor = args.currentData.hypervisorid;
} }