From 0ca7dbccf61056620578b48f2da125bbb116c5b4 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Mon, 15 Nov 2021 12:44:33 +0530 Subject: [PATCH] Ensure that the Binary path for PG14 should be visible in the preferences. Fixes #6972 --- docs/en_US/release_notes_6_2.rst | 1 + web/pgadmin/browser/server_groups/servers/types.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_6_2.rst b/docs/en_US/release_notes_6_2.rst index 69026cb93..86695e60f 100644 --- a/docs/en_US/release_notes_6_2.rst +++ b/docs/en_US/release_notes_6_2.rst @@ -34,6 +34,7 @@ Bug fixes | `Issue #6940 `_ - Fixed an issue where user details are not shown when the non-admin user tries to connect to the shared server. | `Issue #6949 `_ - Ensure that dialog should be opened when clicking on Reassign/Drop owned menu. | `Issue #6954 `_ - Ensure that changing themes should work on Windows when system high contrast mode is enabled. +| `Issue #6972 `_ - Ensure that the Binary path for PG14 should be visible in the preferences. | `Issue #6974 `_ - Added operators and aggregates in search objects. | `Issue #6976 `_ - Fixed an issue where textarea should be allowed to resize and have more than 255 chars. | `Issue #6988 `_ - Reset the layout if pgAdmin4 detects the layout is in an inconsistent state. diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index 7fc468fb5..5d99b1493 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -102,11 +102,18 @@ class ServerType(object): bin_paths_server_based = \ copy.deepcopy(BINARY_PATHS['as_bin_paths']) + bin_path_dict = \ + {item['version']: item for item in bin_paths_server_based} + old_path_dict = \ + {item['version']: item for item in json.loads(old_path)} + + for item in bin_path_dict: + bin_path_dict[item].update(old_path_dict.get(item, {})) + + bin_paths_server_based = list(bin_path_dict.values()) if not ServerType.is_binary_path_of_type_json(old_path): set_binary_path(old_path, bin_paths_server_based, key, set_as_default=True) - else: - bin_paths_server_based = json.loads(old_path) # Set the DEFAULT_BINARY_PATHS if any ServerType.set_default_binary_path(bin_paths_server_based, key)