To recreate: - have multiple libraries in your system as valid pickup locations - place a hold via the staff client, see that all your libraries appear in the pickup location dropdowns at the bib and item level - update RESTPublicAPI, set the value to something lower than your count of pickup libraries - place another hold, confirm your pickup location list gets cut off and only shows as many locations as RESTPublicAPI allows We should show all valid options, even if it goes above the number set in RESTPublicAPI.
Created attachment 127071 [details] [review] Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic This patch makes the select2 dropdowns for pickup locations not be limited to the RESTdefaultPageSize syspref limit. To test: 1. Have less than 20 libraries in your system as valid pickup locations 2. Place a hold via the staff client => SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level 3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries 4. place another hold => FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows 5. Apply this patch 6. Repeat 4 => SUCCESS: All your pickup locations show 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This fixed the bib-level selector, but not the item-level selector. At item-level, my choices are still getting limited by RESTPublicAPI
Created attachment 127073 [details] [review] Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic This patch makes the select2 dropdowns for pickup locations not be limited to the RESTdefaultPageSize syspref limit. To test: 1. Have less than 20 libraries in your system as valid pickup locations 2. Place a hold via the staff client => SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level 3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries 4. place another hold => FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows 5. Apply this patch 6. Repeat 4 => SUCCESS: All your pickup locations show 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 127074 [details] [review] Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic This patch makes the select2 dropdowns for pickup locations not be limited to the RESTdefaultPageSize syspref limit. To test: 1. Have less than 20 libraries in your system as valid pickup locations 2. Place a hold via the staff client => SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level 3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries 4. place another hold => FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows 5. Apply this patch 6. Repeat 4 => SUCCESS: All your pickup locations show 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Confirmed Tomas's second patch also fixes the item-level selector. Also, belatedly realized I gave the wrong syspref name, I should have said RESTdefaultPageSize. Luckily, y'all knew what I meant.
Created attachment 127187 [details] [review] Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic This patch makes the select2 dropdowns for pickup locations not be limited to the RESTdefaultPageSize syspref limit. To test: 1. Have less than 20 libraries in your system as valid pickup locations 2. Place a hold via the staff client => SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level 3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries 4. place another hold => FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows 5. Apply this patch 6. Repeat 4 => SUCCESS: All your pickup locations show 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Cool.. I wasn't aware passing -1 for page size worked to disable the limits.. nice. Works as expected, QA scripts are happy. Passing QA
I am not sure it makes sense, there is a filter to retrieve those not displayed. What about Koha installations with hundreds of libraries?
(will push anyway)
(In reply to Jonathan Druart from comment #8) > I am not sure it makes sense, there is a filter to retrieve those not > displayed. What about Koha installations with hundreds of libraries? My feeling was the same. That changing the query to 'contains' would make their libraries show up even with the limit. For the record: this was requested by a library with hundreds of branches, that has difficulties to find the branches.
Pushed to master for 21.11, thanks to everybody involved!
Must admit I was also surprised by this one.. but it did what is says on the box as it were. I thought Select2 supported 'infinite scrolling' using API paging.. https://select2.org/data-sources/ajax#pagination.. doesn't that work here without calling '-1'?