Bug 39389 - Cannot use dataTables export function on checkout table in members/moremember.pl
Summary: Cannot use dataTables export function on checkout table in members/moremember.pl
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-19 20:44 UTC by Lucas Gass (lukeg)
Modified: 2025-05-06 16:53 UTC (History)
9 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39389: Don't stringify the system preference value (2.17 KB, patch)
2025-04-02 14:21 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39389: Don't stringify the system preference value (2.22 KB, patch)
2025-04-03 14:17 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 39389: Don't stringify the system preference value (2.26 KB, patch)
2025-04-04 11:31 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 39389: Don't stringify the system preference value (2.32 KB, patch)
2025-05-02 17:04 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-03-19 20:44:31 UTC
To recreate:

1. Find a patron with some checkouts
2. Go to members/moremember.pl?borrowernumber=X where x is the borrowernumber
3. Load the checkout table 
4. Click 'Export' and choose any option. 


Uncaught TypeError: t.aoFooter[(intermediate value)][e] is undefined
Comment 1 Carolyn Hughesman 2025-03-21 17:47:15 UTC
We are experiencing this bug too.
Comment 2 Nick Clemens (kidclamp) 2025-04-02 14:21:14 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2025-04-03 14:17:25 UTC
Created attachment 180570 [details] [review]
Bug 39389: Don't stringify the system preference value

This bug is caused by the code that is intended to hide the export column when disabled failing
because the value of exports_enabled is "0" and not 0

To test:
1 - Checkout an item to a patron
2 - Disable ExportCircHistory
3 - Load the patron's circulation table on the Check Out tab
4 - Notice no export column
5 - Click 'Export' above the table and you can export
6 - Go to the patron's circulation table on the Details tab
7 - The export column shows
8 - Try to export - JS error
9 - Apply patch
10 - Clear local storage in the browser
11 - Repeat 3-6 - no more export column and you can export
12 - Enable ExportCircHistory
13 - Confirm the circ table on both pages hsows the export column and can be exported
     (You may need to clear local storage again)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 4 Biblibre Sandboxes 2025-04-04 11:31:21 UTC
Created attachment 180626 [details] [review]
Bug 39389: Don't stringify the system preference value

This bug is caused by the code that is intended to hide the export column when disabled failing
because the value of exports_enabled is "0" and not 0

To test:
1 - Checkout an item to a patron
2 - Disable ExportCircHistory
3 - Load the patron's circulation table on the Check Out tab
4 - Notice no export column
5 - Click 'Export' above the table and you can export
6 - Go to the patron's circulation table on the Details tab
7 - The export column shows
8 - Try to export - JS error
9 - Apply patch
10 - Clear local storage in the browser
11 - Repeat 3-6 - no more export column and you can export
12 - Enable ExportCircHistory
13 - Confirm the circ table on both pages hsows the export column and can be exported
     (You may need to clear local storage again)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Janne <janne.seppanen@lahti.fi>
Comment 5 Lucas Gass (lukeg) 2025-05-02 17:04:00 UTC
Trivial fix that makes perfect sense, QAing here.
Comment 6 Lucas Gass (lukeg) 2025-05-02 17:04:41 UTC
Created attachment 181878 [details] [review]
Bug 39389: Don't stringify the system preference value

This bug is caused by the code that is intended to hide the export column when disabled failing
because the value of exports_enabled is "0" and not 0

To test:
1 - Checkout an item to a patron
2 - Disable ExportCircHistory
3 - Load the patron's circulation table on the Check Out tab
4 - Notice no export column
5 - Click 'Export' above the table and you can export
6 - Go to the patron's circulation table on the Details tab
7 - The export column shows
8 - Try to export - JS error
9 - Apply patch
10 - Clear local storage in the browser
11 - Repeat 3-6 - no more export column and you can export
12 - Enable ExportCircHistory
13 - Confirm the circ table on both pages hsows the export column and can be exported
     (You may need to clear local storage again)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Janne <janne.seppanen@lahti.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 David Cook 2025-05-05 00:50:51 UTC
Yep looks good at a glance. Generally I don't like to see quotes disappear from Javascript, but this is a sensible change which doesn't introduce any security issues.
Comment 8 Katrin Fischer 2025-05-06 16:53:57 UTC
Pushed for 25.05!

Well done everyone, thank you!