Bugzilla – Attachment 178804 Details for
Bug 38844
Display location filter breaks News
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38844: Fix location filter for News html customizations
Bug-38844-Fix-location-filter-for-News-html-custom.patch (text/plain), 3.00 KB, created by
Brendan Lawlor
on 2025-02-27 17:54:36 UTC
(
hide
)
Description:
Bug 38844: Fix location filter for News html customizations
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2025-02-27 17:54:36 UTC
Size:
3.00 KB
patch
obsolete
>From bb50edb1f88ad69747c08ab4b78bc062f60b8c1a Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >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 @@ > <li> > <label for="news_library">Library: </label> > <select id="news_library" name="news_library"> >- <option value=""></option> > <option value="">All libraries</option> > [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %] > </select> >@@ -405,7 +404,7 @@ > <td> > [% IF c.category == 'news' || c.category == 'pages' %] > [% IF c.location == 'staff_and_opac' %] >- <span>All</span> >+ <span>Staff interface and OPAC</span> > [% ELSIF c.location == 'staff_only' %] > <span>Staff interface</span> > [% 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 <option>'s text, not its value >+ var term = $(this).find("option:selected").text(); >+ if (term == "All") { >+ term = ""; >+ } > filterDataTable(table, 1, term); > }); > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38844
:
178804
|
178805