public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] fix #4627: ui: backup edit: don't deselect all vms on load
@ 2023-03-31 10:03 Dominik Csapak
  2023-04-12 11:28 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-03-31 10:03 UTC (permalink / raw)
  To: pve-devel

'selectPoolMembers' will be called when the poolid field changes.
(That can even happen when the mode is not even 'pool')
Due to how the fields are set, there is a race condition that this
will be called after the remaining fields were set up, including
the vm list that might have entires selected.

Since the first thing we do here is to deselect all, this wiped
the vm selection sometimes.

To fix it, check if we're actually in the correct mode before doing
anything.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/dc/Backup.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 7c6e244af..03a026513 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -96,6 +96,12 @@ Ext.define('PVE.dc.BackupEdit', {
 
 	selectPoolMembers: function() {
 	    let me = this;
+	    let mode = me.lookup('modeSelector').getValue();
+
+	    if (mode !== 'pool') {
+		return;
+	    }
+
 	    let vmgrid = me.lookup('vmgrid');
 	    let poolid = me.lookup('poolSelector').getValue();
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] fix #4627: ui: backup edit: don't deselect all vms on load
  2023-03-31 10:03 [pve-devel] [PATCH manager] fix #4627: ui: backup edit: don't deselect all vms on load Dominik Csapak
@ 2023-04-12 11:28 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-04-12 11:28 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 31/03/2023 um 12:03 schrieb Dominik Csapak:
> 'selectPoolMembers' will be called when the poolid field changes.
> (That can even happen when the mode is not even 'pool')
> Due to how the fields are set, there is a race condition that this
> will be called after the remaining fields were set up, including
> the vm list that might have entires selected.
> 
> Since the first thing we do here is to deselect all, this wiped
> the vm selection sometimes.
> 
> To fix it, check if we're actually in the correct mode before doing
> anything.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/dc/Backup.js | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-12 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 10:03 [pve-devel] [PATCH manager] fix #4627: ui: backup edit: don't deselect all vms on load Dominik Csapak
2023-04-12 11:28 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal