Bug 34592: Patron Search filter fields needs to be at least an empty array

If buildPatronSearchQuery() doesn't return an empty array when it exits
early, then the code that adds the sort fields to the filters will fail.

Test plan:

- If there is not all ready a patron with a sort1 or sort2 value from
  the bSort1 or bSort2 authorized values, add an authorized value if
  necessary.
- Add a patron if necessary, and set the patrons sort field to the added
  value.
- In Tools -> Patron card creator start a new card batch.
- Click on Add Patron(s) to open the patron search window.
- Pick the value in either the sort1 or sort2 drop down.
- Submit the page.  The page will reload and there won't be results.
- Apply the patch, close the patron search window, clear the browser
  cache, reload the "New patron card batch" page, and open the patron
  search window again.
- Repeat the search. There will be results.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Michael Hafen 2023-08-24 10:27:36 -06:00 committed by Tomas Cohen Arazi
parent cb6dd4e82b
commit 275197f405
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -534,7 +534,7 @@ function buildPatronSearchQuery(term, options) {
// Bail if no patterns
if (patterns.length == 0) {
return;
return q;
}
// Leading wildcard: If search_type option exists, we use that