From c7a0db793bb79e58e4ea6ce6ea0e0d522f02e7a8 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Thu, 27 Feb 2025 17:43:32 +0000 Subject: [PATCH] Bug 38844: Fix location filter for News html customizations This patch changes the #news_display_location filter to use the option's text instead of it's value. The filter previously did not work when the location field in additional_contents used snake case as in staff_only. Test plan: 1. Go to Tools > News 2. Add a news item for each of the location types (Staff interface and OPAC, Staff interface, OPAC, Slip) 3. Go back to the News landing page 4. Try using the "Display location" filter in the left column to filter the table of news items - only the "All" and "Slip" choices work correctly. 5. Apply patch 6. Confirm the "Display location" filter works for All, Staff interface and OPAC, Staff interface, OPAC, and Slip --- .../prog/en/modules/tools/additional-contents.tt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt index 75e1a5215b..e3f5cc2e2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -174,7 +174,6 @@
  • @@ -405,7 +404,7 @@ [% IF c.category == 'news' || c.category == 'pages' %] [% IF c.location == 'staff_and_opac' %] - All + Staff interface and OPAC [% ELSIF c.location == 'staff_only' %] Staff interface [% ELSIF c.location == 'opac_only' %] @@ -647,8 +646,12 @@ }); $("#news_display_location").on("change", function () { - var term = $(this).val(); - filterDataTable(table_dt, 1, term); + // Table must be filtered by the