From b1538fec48d3cdbac6d4042f1710fb3ef244f4ac Mon Sep 17 00:00:00 2001 From: lorisadmin Date: Mon, 11 Mar 2024 20:52:30 +0000 Subject: [PATCH 1/2] [configuration] Fix option deletion issue. --- modules/configuration/jsx/configuration_helper.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/configuration/jsx/configuration_helper.js b/modules/configuration/jsx/configuration_helper.js index 4be71bf2273..324d4ab6446 100644 --- a/modules/configuration/jsx/configuration_helper.js +++ b/modules/configuration/jsx/configuration_helper.js @@ -39,14 +39,12 @@ $(function() { $('.btn-remove').on('click', function(e) { e.preventDefault(); - let options = $(this).parent().parent().children().prop('options'); - let selectedIndex = $(this) - .parent().parent().children() - .prop('selectedIndex'); - let selectedOption = options[selectedIndex].text; - let fieldName = $(this) - .parent().parent().parent().parent().parent().children() - .attr('data-original-title'); + let selectedOption = $(this).parent().parent().children() + .prop('value'); + + let fieldName = $(this) + .parent().parent().parent().parent().parent().children() + .attr('data-original-title'); swal.fire({ text: 'Please confirm you want to delete the option "' + From 1f404af4c67216706973370ae92ed18bebf59e0c Mon Sep 17 00:00:00 2001 From: lorisadmin Date: Tue, 12 Mar 2024 13:09:07 +0000 Subject: [PATCH 2/2] fixing code standards requirements. --- modules/configuration/jsx/configuration_helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/configuration/jsx/configuration_helper.js b/modules/configuration/jsx/configuration_helper.js index 324d4ab6446..45c6aacc3e8 100644 --- a/modules/configuration/jsx/configuration_helper.js +++ b/modules/configuration/jsx/configuration_helper.js @@ -42,9 +42,9 @@ $(function() { let selectedOption = $(this).parent().parent().children() .prop('value'); - let fieldName = $(this) - .parent().parent().parent().parent().parent().children() - .attr('data-original-title'); + let fieldName = $(this) + .parent().parent().parent().parent().parent().children() + .attr('data-original-title'); swal.fire({ text: 'Please confirm you want to delete the option "' +