From 8dd8d1d03a7cf68bd78020addcfd45b5b9d27ee2 Mon Sep 17 00:00:00 2001 From: San Lin Naing Date: Thu, 13 Jul 2023 14:36:46 +0900 Subject: [PATCH] Fixed an issue where ERD Tool can't load the saved pgerd file from Shared Storage. #6558 --- web/pgadmin/tools/sqleditor/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index 34994c7de..d882cc012 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -1864,9 +1864,18 @@ def load_file(): file_path = unquote(file_data['file_name']) + # get the current storage from request if available + # or get it from last_storage preference. + storage_folder = '' + if 'storage' in file_data: + storage_folder = file_data['storage'] + else: + storage_folder = Preferences.module('file_manager').preference( + 'last_storage').get() + # retrieve storage directory path storage_manager_path = get_storage_directory( - shared_storage=file_data['storage'] if 'storage' in file_data else '') + shared_storage=storage_folder) try: Filemanager.check_access_permission(storage_manager_path, file_path)