From e47be6f895dff0c50d347cd776b8deee07eb9156 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Fri, 13 Sep 2024 16:52:05 -0700 Subject: [PATCH] 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 Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index 1c5b8b51b8..176f126c0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -878,7 +878,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr $("#macro-toolbar").prepend($convert); } let options = { - url: "/api/v1/advanced_editor/macros/", + url: "/api/v1/advanced_editor/macros/?_per_page=-1", method: "GET", contentType: "application/json", }; -- 2.39.5