Bug 36215

Summary: Bookings calendar only shows bookings within RESTdefaultPageSize
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Staff interfaceAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, kkrueger, lucas
Version: MainKeywords: rel_23_11_candidate
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:
24.05.00,23.11.04
Circulation function:
Bug Depends on: 29002    
Bug Blocks:    
Attachments: Bug 36215: Remove limit on fetching bookings
Bug 36215: Remove limit on fetching bookings
Bug 36215: Remove limit on fetching bookings

Description Nick Clemens (kidclamp) 2024-03-01 17:22:32 UTC
If a record has more bookings than the system preference RESTdefaultPageSize they will not appear in the calendar
Comment 1 Martin Renvoize (ashimema) 2024-03-06 17:07:09 UTC
Created attachment 162843 [details] [review]
Bug 36215: Remove limit on fetching bookings

This removes the paging from the bookings request so we take into
account all bookings.

We may want to replace this with date bounded paging in the future, but
lets not try to optimise until we need to.
Comment 2 Nick Clemens (kidclamp) 2024-03-06 17:59:41 UTC
Created attachment 162846 [details] [review]
Bug 36215: Remove limit on fetching bookings

This removes the paging from the bookings request so we take into
account all bookings.

We may want to replace this with date bounded paging in the future, but
lets not try to optimise until we need to.

To test:
 1 - Find a record detail page in Koha staff interface
 2 - Click on a barcode to go to items tab
 3 - Edit 'bookable' to 'yes'
 4 - Return to details page
 5 - Place 5 bookings on a record
 6 - Set system preference RESTDefaultPageSize  2
 7 - Click the 'Bookings' tab on the record details
 8 - Confirm onyl 2 bookings shown in calendar view
 9 - Apply patch, reload
10 - All bookings now show in calendar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Nick Clemens (kidclamp) 2024-03-06 18:00:25 UTC
Redid the patch to add param with '?' and not '&' :-)
Minor change, works, can go straight to QA
Comment 4 Tomás Cohen Arazi (tcohen) 2024-03-11 18:02:55 UTC
Created attachment 163051 [details] [review]
Bug 36215: Remove limit on fetching bookings

This removes the paging from the bookings request so we take into
account all bookings.

We may want to replace this with date bounded paging in the future, but
lets not try to optimise until we need to.

To test:
 1 - Find a record detail page in Koha staff interface
 2 - Click on a barcode to go to items tab
 3 - Edit 'bookable' to 'yes'
 4 - Return to details page
 5 - Place 5 bookings on a record
 6 - Set system preference RESTDefaultPageSize  2
 7 - Click the 'Bookings' tab on the record details
 8 - Confirm onyl 2 bookings shown in calendar view
 9 - Apply patch, reload
10 - All bookings now show in calendar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Katrin Fischer 2024-03-12 16:49:36 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2024-03-13 08:06:44 UTC
Ah sure about this change ?

         // Fetch list of bookable items
         let itemsFetch = $.ajax({
-            url: '/api/v1/biblios/' + biblionumber + '/items?bookable=1' + '&_per_page=-1',
+            url: '/api/v1/biblios/' + biblionumber + '/items?bookable=1' + '?_per_page=-1',


Looks like it will generate two question mark:
  url: '/api/v1/biblios/9999/items?bookable=1?_per_page=-1'
Comment 7 Katrin Fischer 2024-03-15 06:59:06 UTC
Will push the follow-up to master in a bit.
Comment 8 Fridolin Somers 2024-03-18 08:51:49 UTC
Pushed to 23.11.x for 23.11.04
Comment 9 Fridolin Somers 2024-03-18 08:52:25 UTC
I see there is a follwup in master :
  Bug 36215: (QA follow-up) Fix &? confusion
Backported to 23.11.x
Comment 10 Martin Renvoize (ashimema) 2024-03-18 08:55:34 UTC
I could have sworn Nick already fixed that inline during QA.. clearly we missed a second case between us!