From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 7BE3E1FF0E0 for ; Thu, 06 Aug 2026 15:02:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 49B7A21577; Thu, 06 Aug 2026 15:02:26 +0200 (CEST) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 2/2] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field Date: Thu, 6 Aug 2026 15:01:30 +0200 Message-ID: <20260806130152.207884-3-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260806130152.207884-1-j.theisen@proxmox.com> References: <20260806130152.207884-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1786021313675 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VJGBOPBEK2HAFB6BAOF4GBUNAK7V5HHV X-Message-ID-Hash: VJGBOPBEK2HAFB6BAOF4GBUNAK7V5HHV X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The `autoSelect` configuration in `DiskStorageSelector` relies on the underlying `ComboGrid` store's `load` event to select the first available storage. When the field is disabled and subsequently re-enabled, the `load` event does not fire again. Consequently, the field remains empty despite `autoSelect` being configured. Fix this by explicitly handling the auto-selection logic inside the `setDisabled` method. When the field is being enabled and is currently empty, select the first record from the cached store. Contributed-by: Elias Huhsovitz Signed-off-by: Jonas Theisen --- www/manager6/form/DiskStorageSelector.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/manager6/form/DiskStorageSelector.js b/www/manager6/form/DiskStorageSelector.js index 696f9033..f0af07ec 100644 --- a/www/manager6/form/DiskStorageSelector.js +++ b/www/manager6/form/DiskStorageSelector.js @@ -117,6 +117,11 @@ Ext.define('PVE.form.DiskStorageSelector', { // reset on disable if (value) { hdstorage.setValue(); + } else if (me.autoSelect && !hdstorage.getValue()) { + let rec = hdstorage.getStore().first(); + if (rec && rec.data) { + hdstorage.setValue(rec.data[hdstorage.valueField], true); + } } hdstorage.setDisabled(value); -- 2.47.3