From c3f6c674d854a78285ac0a17ea23cec18f782394 Mon Sep 17 00:00:00 2001 From: Andre Wachsmuth Date: Fri, 13 Dec 2024 20:38:57 +0100 Subject: [PATCH] Fixes Studio-42/elFinder#3689, fm.sync removes unavailable volumes. When a request is made to the server with the open command and tree=1, the server must reply with a list of all volumes. If the server's response does not include a volume ElFinder already knows about, that volume should be treated as not available anymore and get removed from the file explorer UI. --- js/elFinder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/elFinder.js b/js/elFinder.js index 20707b844..371713eae 100644 --- a/js/elFinder.js +++ b/js/elFinder.js @@ -2302,6 +2302,8 @@ var elFinder = function(elm, opts, bootCallback) { isBinary = (opts.options || {}).dataType === 'binary', // current cmd is "open" isOpen = (!opts.asNotOpen && cmd === 'open'), + // the tree option is enabled (for "open" command) + isTree = (data.tree === 1), // call default fail callback (display error dialog) ? deffail = !(isBinary || opts.preventDefault || opts.preventFail), // call default success callback ? @@ -2523,7 +2525,7 @@ var elFinder = function(elm, opts, bootCallback) { }, actionTarget; - if (isOpen) { + if (isOpen && !isTree) { pushLeafRoots('files'); } else if (cmd === 'tree') { pushLeafRoots('tree');