From 2f75964ad0cb9eb121d762d720571a2c8b101a24 Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Mon, 12 Feb 2018 17:24:06 +0100 Subject: [PATCH] B #1725: Error importing vCenter templates (#1726) (cherry picked from commit 91f4d0f03901a03d638ef1595c5b6c0c12dbbfe9) --- .../public/app/utils/vcenter/templates.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/sunstone/public/app/utils/vcenter/templates.js b/src/sunstone/public/app/utils/vcenter/templates.js index 692078fe41..2f8da216c2 100644 --- a/src/sunstone/public/app/utils/vcenter/templates.js +++ b/src/sunstone/public/app/utils/vcenter/templates.js @@ -411,6 +411,10 @@ define(function(require) { that = this; $.each($(".vcenter_import_table", context), function() { $.each($(this).DataTable().$(".check_item:checked"), function() { + var vcenter_ref = $(this).data("import_data").vcenter_ref; + var linked = false; + var copy = false; + var templateName = ""; var row_context = $(this).closest("tr"); VCenterCommon.importLoading({context : row_context}); @@ -427,21 +431,16 @@ define(function(require) { var createCopy = $('.create_copy', rpInput).prop("checked"); var templateName = $('.template_name', rpInput).val(); - var vcenter_ref = $(this).data("import_data").vcenter_ref; if (linkedClone) { - var linked = true; + linked = true; if (createCopy && templateName != "") { - var copy = true; - var template_name = templateName; + copy = true; + template_name = templateName; } else { - var copy = false; - var template_name = ""; + copy = false; + template_name = ""; } - } else { - var template_name = ""; - var linked = false; - var copy = false; } $.each($('.available_rps option:selected', rpInput), function(){