From 2f22a18eafb89fdccca907b61fe39b5138b48499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 25 Apr 2013 16:37:59 +0200 Subject: [PATCH] Bug #1956: Template name is now mandatory --- src/sunstone/public/js/plugins/templates-tab.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 18485c3ae4..e60ff6898b 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -542,7 +542,7 @@ function generate_capacity_tab_content() { ''+ ''+ '
'+ - '
'+tr("Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.")+'
'+ + '
'+tr("Name that the VM will get for description purposes.")+'
'+ '
'+ ''+ '
'+ @@ -3512,6 +3512,14 @@ function setupCreateTemplateDialog(){ //wrap it in the "vmtemplate" object var vm_json = build_template(); vm_json = {vmtemplate: vm_json}; + + if (vm_json.vmtemplate.NAME == undefined || + vm_json.vmtemplate.NAME.length == 0 ) { + + notifyError(tr("Virtual Machine name missing!")); + return false; + } + //validate form Sunstone.runAction("Template.create",vm_json);