From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id EE95B606E6 for ; Thu, 26 Nov 2020 09:24:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E00DCC9DA for ; Thu, 26 Nov 2020 09:23:40 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 76C6DC9D2 for ; Thu, 26 Nov 2020 09:23:40 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3E6C344055 for ; Thu, 26 Nov 2020 09:23:40 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Thu, 26 Nov 2020 09:23:39 +0100 Message-Id: <20201126082339.11959-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.306 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [rec.data] Subject: [pve-devel] [PATCH widget-toolkit] fix usage of findRecord 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: , X-List-Received-Date: Thu, 26 Nov 2020 08:24:11 -0000 findRecord does not match exactly, but only at the beginning and case insensitive, by default. Change all calls to be case sensiti and an exactmatch (we never want the default behaviour afaics). Signed-off-by: Dominik Csapak --- src/form/ComboGrid.js | 4 ++-- src/form/RealmComboBox.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js index 20c9455..07ea5fe 100644 --- a/src/form/ComboGrid.js +++ b/src/form/ComboGrid.js @@ -346,14 +346,14 @@ Ext.define('Proxmox.form.ComboGrid', { if (Ext.isArray(value)) { Ext.Array.each(value, function(v) { - if (store.findRecord(me.valueField, v)) { + if (store.findRecord(me.valueField, v, 0, false, true, true)) { found = true; return false; // break } return true; }); } else { - found = !!store.findRecord(me.valueField, value); + found = !!store.findRecord(me.valueField, value, 0, false, true, true); } return found; diff --git a/src/form/RealmComboBox.js b/src/form/RealmComboBox.js index 309bf4f..5f61687 100644 --- a/src/form/RealmComboBox.js +++ b/src/form/RealmComboBox.js @@ -15,7 +15,7 @@ Ext.define('Proxmox.form.RealmComboBox', { } let me = this; let val = me.getValue(); - if (!val || !me.store.findRecord('realm', val)) { + if (!val || !me.store.findRecord('realm', val, 0, false, true, true)) { let def = 'pam'; Ext.each(records, function(rec) { if (rec.data && rec.data.default) { -- 2.20.1