From de2022b85c2d3d56d71216957e55769c82ea8fd7 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 14 Jun 2017 08:52:59 +0200 Subject: [PATCH] use correct vmid for id when in vm replication panel values.guest is only available when the field 'guest' is not a displayfield (e.g. when in vm replication panel), so we have to use the given vmid first and only when this is not available, fall back to the value of the field Signed-off-by: Dominik Csapak --- www/manager6/grid/Replication.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/www/manager6/grid/Replication.js b/www/manager6/grid/Replication.js index 99c7ccc5..942c7263 100644 --- a/www/manager6/grid/Replication.js +++ b/www/manager6/grid/Replication.js @@ -67,12 +67,13 @@ Ext.define('PVE.window.ReplicaEdit', { if (me.isCreate) { values.type = 'local'; + var vm = vmid || values.guest; var id = -1; - if (me.highestids[values.guest] !== undefined) { - id = me.highestids[values.guest]; + if (me.highestids[vm] !== undefined) { + id = me.highestids[vm]; } id++; - values.id = values.guest + '-' + id.toString(); + values.id = vm + '-' + id.toString(); delete values.guest; } return values;