From c7c199210dbd7971c96fce4c67d7b4ec14585cda Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Tue, 29 Sep 2020 11:03:38 +0530 Subject: [PATCH] Fixed an issue where file extension is stripped on renaming a file. Fixes #4855 --- docs/en_US/release_notes_4_27.rst | 1 + web/pgadmin/misc/file_manager/static/js/utility.js | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_4_27.rst b/docs/en_US/release_notes_4_27.rst index 9f196f86c..12647263f 100644 --- a/docs/en_US/release_notes_4_27.rst +++ b/docs/en_US/release_notes_4_27.rst @@ -21,6 +21,7 @@ Bug fixes ********* | `Issue #4806 `_ - Added useful message when the explain plan is not used and empty. +| `Issue #4855 `_ - Fixed an issue where file extension is stripped on renaming a file. | `Issue #5131 `_ - Ensure that 'ctrl + a' shortcut does not move the cursor in SQL editor. | `Issue #5417 `_ - Fixed and improve API test cases for the schema diff tool. | `Issue #5739 `_ - Ensure that the import/export feature should work with SSH Tunnel. diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js index 78dfe8126..3494b127c 100644 --- a/web/pgadmin/misc/file_manager/static/js/utility.js +++ b/web/pgadmin/misc/file_manager/static/js/utility.js @@ -867,7 +867,7 @@ define([ $('.fileinfo #contents li div').on('blur dblclick', 'input', function(e) { e.stopPropagation(); - var old_name = decodeURI($(this).siblings('span').attr('title')); + var old_name = decodeURI($(this).siblings('div').find('.less_text').attr('title')); newvalue = old_name.substring(0, old_name.indexOf('.')); var last = getFileExtension(old_name), file_data, new_name, file_path, full_name; @@ -945,7 +945,7 @@ define([ $('.fileinfo table#contents tr td div').on( 'blur dblclick', 'input', function(e) { - var old_name = decodeURI($(this).siblings('span').attr('title')), + var old_name = decodeURI($(this).siblings('div').find('.less_text').attr('title')), new_value = old_name.substring(0, old_name.indexOf('.')), last = getFileExtension(old_name); if (old_name.indexOf('.') == 0) { @@ -974,8 +974,7 @@ define([ if (new_value !== new_name) { renameItem(file_data); - var parent = file_path.split('/').reverse().slice(2).reverse().join('/') + '/'; - getFolderInfo(parent); + getFolderInfo($('.currentpath').val()); } } } else {