From bb50edb1f88ad69747c08ab4b78bc062f60b8c1a 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 7487064420..4422011b95 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' %] @@ -648,7 +647,11 @@ }); $("#news_display_location").on("change", function () { - var term = $(this).val(); + // Table must be filtered by the