From c529e53b89eb2478d84254fcbf7dccee53a934e0 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 31 Aug 2023 08:57:20 +0000 Subject: [PATCH] Bug 34431: (QA follow-up) Fix duplicate backend options Prevent adding backend option if the option already exists Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 91b4eb2386..be491f4921 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -533,10 +533,12 @@ $(document).ready(function() { }, success: function(backends){ backends.sort((a, b) => a.ill_backend_id.localeCompare(b.ill_backend_id)).forEach(function(backend) { - $('#illfilter_backend').append( - '' - ); + if( $('#illfilter_backend option[value=' + backend.ill_backend_id + ']').length == 0 ){ + $('#illfilter_backend').append( + '' + ); + } }); let all_existing_statuses = []; @@ -569,7 +571,6 @@ $(document).ready(function() { } } ) - } }); } -- 2.39.5