Bug 29729

Summary: If serials_stats.pl returns no results dataTables get angry
Product: Koha Reporter: Lucas Gass <lucas>
Component: ReportsAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: andrewfh, kyle, nugged, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.02,21.05.08
Attachments: Bug 29729: Build a tr for each subscription
Bug 29729: Build a tr for each subscription
Bug 29729: Build a tr for each subscription

Description Lucas Gass 2021-12-17 21:06:42 UTC
To recreate:

To to Reports > Serials > Serials subscriptions and run the report while selecting a branch without subscriptions. 
Notice that console error:

datatables.min_21.1200002.js:62 Uncaught TypeError: Cannot set properties of undefined (setting '_DT_CellIndex')

If you run the report for a branch WITH subscriptions it works just fine.
Comment 1 Lucas Gass 2021-12-17 21:12:32 UTC
Created attachment 128686 [details] [review]
Bug 29729: Build a tr for each subscription

To test:
1 To to Reports > Serials > Serials subscriptions and run the report while selecting a branch without subscriptions.
2 Notice console error
3 If you run the report for a branch WITH subscriptions it works just fine.
4 Apply patch
5 Do 1 again, no console error and show no see 'No entries to show'
6 Make sure it also works when you have a few subscriptions for a branch as well
Comment 2 Andrew Fuerste-Henry 2021-12-17 21:29:07 UTC
Created attachment 128687 [details] [review]
Bug 29729: Build a tr for each subscription

To test:
1 To to Reports > Serials > Serials subscriptions and run the report while selecting a branch without subscriptions.
2 Notice console error
3 If you run the report for a branch WITH subscriptions it works just fine.
4 Apply patch
5 Do 1 again, no console error and show no see 'No entries to show'
6 Make sure it also works when you have a few subscriptions for a branch as well

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Katrin Fischer 2021-12-18 21:53:31 UTC
Created attachment 128699 [details] [review]
Bug 29729: Build a tr for each subscription

To test:
1 To to Reports > Serials > Serials subscriptions and run the report while selecting a branch without subscriptions.
2 Notice console error
3 If you run the report for a branch WITH subscriptions it works just fine.
4 Apply patch
5 Do 1 again, no console error and show no see 'No entries to show'
6 Make sure it also works when you have a few subscriptions for a branch as well

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2021-12-18 21:53:56 UTC
Nice catch :)
Comment 5 Fridolin Somers 2022-01-04 06:59:46 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 6 Kyle M Hall 2022-01-07 11:17:22 UTC
Pushed to 21.11.x for 21.11.02
Comment 7 Andrew Fuerste-Henry 2022-01-10 15:52:52 UTC
Pushed to 21.05.x for 21.05.08
Comment 8 Victor Grousset/tuxayo 2022-02-07 11:51:25 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.