Bug 36215 - Bookings calendar only shows bookings within RESTdefaultPageSize
Summary: Bookings calendar only shows bookings within RESTdefaultPageSize
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords: rel_23_11_candidate
Depends on: 29002
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-01 17:22 UTC by Nick Clemens (kidclamp)
Modified: 2024-03-19 21:28 UTC (History)
4 users (show)

See Also:
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:


Attachments
Bug 36215: Remove limit on fetching bookings (1.89 KB, patch)
2024-03-06 17:07 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36215: Remove limit on fetching bookings (2.67 KB, patch)
2024-03-06 17:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36215: Remove limit on fetching bookings (2.73 KB, patch)
2024-03-11 18:02 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!