When looking at News, if you change the display location filter to anything except all, nothing shows. This filter appears to be broken.
Hi Christopher, were you logged in when looking at the page?
Can confirm this is happening on our system and main as well. To replicate: 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.
Ah! I was totally in the wrong place. Thanks for explaining!
This seems to be an issue with the data table filter not liking snake case that is used in additional_contents for location for staff_only, opac_only and staff_and_opac. For other HTML customizations that work the location is in camel case like CookieConsentPopup. Not sure if we can do something to have the datatable filter escape the _ or if we should change the the snake case to camel case wherever it's required. Another possible solution would be to have the filter use the option's text instead of its value as is done for the Library column for some reason.
Created attachment 178804 [details] [review] 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
Created attachment 178805 [details] [review] 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
Can't get this to work, sorry. - Applied the patch - yarn js:build - restart_all - Tested in a regular window and am incognito window The table shows news for all the different locations. Changing the "Display location" dropdown does not affect the table at all, all items are always displayed. I see this in the console: additional-contents.pl:2057 Uncaught TypeError: table.column is not a function at filterDataTable (additional-contents.pl:2057:27) at HTMLSelectElement.<anonymous> (additional-contents.pl:2133:21) at HTMLSelectElement.dispatch (jquery-3.6.0.min_24.1200015.js:2:43064) at v.handle (jquery-3.6.0.min_24.1200015.js:2:41048)