From b5113ea39b7d36de300b5b2eb22753ecc5dedc5d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Mar 2024 14:16:23 +0100 Subject: [PATCH] Bug 36394: Fix footers behaviour on the ES mapping page In the footers of the tables of the search fields and mappings, the options selected are not consistent. Additionally they are not reset correctly when a new line is added. Test plan: 0. Do not apply to recreate the problem 1. Go to the ES mapping page 2. Click tab "Bibliographic records" 3. At the bottom, notice the Yes/No dropdown lists => They are inconsistent, sometimes 'Yes', sometimes 'No' 4. Click Add => Values are kept 5. Apply this patch 6. Repeat 1, 2, 3 => No (first option) is always selected 7. Click Add after you modified some values => "No" is selected Sponsored-by: The Research University in the Helmholtz Association (KIT) --- .../searchengine/elasticsearch/mappings.tt | 36 +++++-------------- .../prog/js/elasticsearch-mappings.js | 2 +- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index 2921fd3c0b3..9d0022a2612 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -455,46 +455,26 @@ a.add, a.delete { diff --git a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js b/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js index 1e747da5aad..d0f27a46d28 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js +++ b/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js @@ -2,7 +2,7 @@ function clean_line(line) { $(line).find('input[type="text"]').val(""); - $(line).find('select').find('option:first').attr("selected", "selected"); + $(line).find('select').find('option:first').prop("selected", true); } function clone_line(line) { -- 2.34.1