Bug 26929 - Koha will only display the first 20 macros Advanced Editor
Summary: Koha will only display the first 20 macros Advanced Editor
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Phil Ringnalda
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on: 17268
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-04 20:04 UTC by Kelly McElligott
Modified: 2024-11-18 22:19 UTC (History)
7 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.11.00,24.05.06
Circulation function:


Attachments
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize (2.13 KB, patch)
2024-09-14 00:09 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize (2.18 KB, patch)
2024-09-26 14:35 UTC, Olivier Vezina
Details | Diff | Splinter Review
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize (2.24 KB, patch)
2024-09-26 14:46 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 Kelly McElligott 2020-11-04 20:04:37 UTC
In 20.05, if a library has more than 20 macros, then they will not appear on the screen and will not be accessible to the cataloger.  

The current workaround, upping the value in this system preference, RESTdefaultPageSize - increased to 40, this will display the rest of the macros (over 20) for the library.
Comment 1 Phil Ringnalda 2024-09-14 00:09:26 UTC
Created attachment 171502 [details] [review]
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize

The REST API has a default page size of 20, controlled by the preference
RESTdefaultPageSize. That's fine for things that are fetched to display
in pages of 20, but for things like macros in the Advanced Editor that
don't implement paging, it's awkward, since when you create your 21st
macro, it disappears the next time you open the editor.

The Advanced Editor should instead disable paging by passing the param
_per_page=-1

Test plan:

1. Set the preference EnableAdvancedCatalogingEditor to Enable. While you
   are there, set the preference RESTdefaultPageSize to 2, so you don't have
   to create 21 macros to see one disappear
2. Cataloging - Advanced editor - Macros
3. Click New macro..., give it the name 1, then repeat for 2 and 3
4. You have a list of macros open with all three listed, so far so good.
   Refresh the browser page and reopen Macros. You now have two macros
5. Apply patch, refresh the page, reopen Macros. You now have three macros
6. You should probably reset that RESTdefaultPageSize back to 20 if you
   aren't about to reset ktd

Sponsored-by: Chetco Community Public Library
Comment 2 Olivier Vezina 2024-09-26 14:35:17 UTC
Created attachment 171979 [details] [review]
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize

The REST API has a default page size of 20, controlled by the preference
RESTdefaultPageSize. That's fine for things that are fetched to display
in pages of 20, but for things like macros in the Advanced Editor that
don't implement paging, it's awkward, since when you create your 21st
macro, it disappears the next time you open the editor.

The Advanced Editor should instead disable paging by passing the param
_per_page=-1

Test plan:

1. Set the preference EnableAdvancedCatalogingEditor to Enable. While you
   are there, set the preference RESTdefaultPageSize to 2, so you don't have
   to create 21 macros to see one disappear
2. Cataloging - Advanced editor - Macros
3. Click New macro..., give it the name 1, then repeat for 2 and 3
4. You have a list of macros open with all three listed, so far so good.
   Refresh the browser page and reopen Macros. You now have two macros
5. Apply patch, refresh the page, reopen Macros. You now have three macros
6. You should probably reset that RESTdefaultPageSize back to 20 if you
   aren't about to reset ktd

Sponsored-by: Chetco Community Public Library
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Comment 3 Lucas Gass (lukeg) 2024-09-26 14:46:16 UTC
Created attachment 171980 [details] [review]
Bug 26929: Fetching macros for Advanced Editor should ignore default pagesize

The REST API has a default page size of 20, controlled by the preference
RESTdefaultPageSize. That's fine for things that are fetched to display
in pages of 20, but for things like macros in the Advanced Editor that
don't implement paging, it's awkward, since when you create your 21st
macro, it disappears the next time you open the editor.

The Advanced Editor should instead disable paging by passing the param
_per_page=-1

Test plan:

1. Set the preference EnableAdvancedCatalogingEditor to Enable. While you
   are there, set the preference RESTdefaultPageSize to 2, so you don't have
   to create 21 macros to see one disappear
2. Cataloging - Advanced editor - Macros
3. Click New macro..., give it the name 1, then repeat for 2 and 3
4. You have a list of macros open with all three listed, so far so good.
   Refresh the browser page and reopen Macros. You now have two macros
5. Apply patch, refresh the page, reopen Macros. You now have three macros
6. You should probably reset that RESTdefaultPageSize back to 20 if you
   aren't about to reset ktd

Sponsored-by: Chetco Community Public Library
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Martin Renvoize (ashimema) 2024-09-30 14:33:43 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 5 Lucas Gass (lukeg) 2024-11-18 22:19:16 UTC
Backported to 24.05.x for upcoming 24.05.06