From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id AB3F81FF56B for ; Mon, 22 Apr 2024 11:02:13 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1CBBFC17D; Mon, 22 Apr 2024 11:02:16 +0200 (CEST) From: Folke Gleumes To: pve-devel@lists.proxmox.com Date: Mon, 22 Apr 2024 11:01:02 +0200 Message-Id: <20240422090101.141532-1-f.gleumes@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager] acme: ui: handle missing meta field in directory response X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" When none of the meta fields is set by the directory, the whole dictionary is missing from the response, leading to an exception when testing for fields inside it. Signed-off-by: Folke Gleumes --- www/manager6/node/ACME.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js index a0db51a6..7fe49171 100644 --- a/www/manager6/node/ACME.js +++ b/www/manager6/node/ACME.js @@ -150,15 +150,18 @@ Ext.define('PVE.node.ACMEAccountCreate', { directory: value, }, success: function(response, opt) { - if (response.result.data.termsOfService) { + if (response.result.data && response.result.data.termsOfService) { field.setValue(response.result.data.termsOfService); disp.setValue(response.result.data.termsOfService); checkbox.setHidden(false); } else { - checkbox.setValue(false); + // Needed to pass input verification and enable register button + // has no influence on the submitted form + checkbox.setValue(true); disp.setValue("No terms of service agreement required"); } - vm.set('eabRequired', !!response.result.data.externalAccountRequired); + vm.set('eabRequired', !!(response.result.data && + response.result.data.externalAccountRequired)); }, failure: function(response, opt) { disp.setValue(undefined); -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel