Bug 34592 - The patron search window, given just a sort field value, doesn't work
Summary: The patron search window, given just a sort field value, doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial (vote)
Assignee: Michael Hafen
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 28726
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-22 18:04 UTC by Michael Hafen
Modified: 2023-12-28 20:47 UTC (History)
3 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:
23.11.00,23.05.04,22.11.10


Attachments
Bug 34592: Patron Search filter fields needs to be at least an empty array (839 bytes, patch)
2023-08-22 18:23 UTC, Michael Hafen
Details | Diff | Splinter Review
ug 34592: Patron Search filter fields needs to be at least an empty array (1.70 KB, patch)
2023-08-24 16:29 UTC, Michael Hafen
Details | Diff | Splinter Review
Bug 34592: Patron Search filter fields needs to be at least an empty array (1.72 KB, patch)
2023-08-25 11:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34592: Patron Search filter fields needs to be at least an empty array (1.78 KB, patch)
2023-08-25 12:10 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hafen 2023-08-22 18:04:21 UTC
In the patron card creator, card batch. When doing a patron search in the patron search window, if only a sort field value is given the form gets submitted and the patron search window comes back without the sort fields.
Comment 1 Michael Hafen 2023-08-22 18:23:54 UTC
Created attachment 154703 [details] [review]
Bug 34592: Patron Search filter fields needs to be at least  an empty array
Comment 2 Owen Leonard 2023-08-24 13:18:47 UTC
The attachment has only a test plan, no patch!
Comment 3 Michael Hafen 2023-08-24 16:29:11 UTC
Created attachment 154742 [details] [review]
ug 34592: Patron Search filter fields needs to be at least  an empty array

(Sorry.  I don't know how that happened.)

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.
Comment 4 Owen Leonard 2023-08-25 11:29:21 UTC
Created attachment 154802 [details] [review]
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>
Comment 5 Katrin Fischer 2023-08-25 12:10:46 UTC
Created attachment 154806 [details] [review]
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>
Comment 6 Tomás Cohen Arazi 2023-08-30 13:06:57 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Jonathan Druart 2023-08-30 13:08:55 UTC
Any changes to patron search should add selenium tests.
Comment 8 Fridolin Somers 2023-08-30 20:18:38 UTC
Pushed to 23.05.x for 23.05.04
Comment 9 Matt Blenkinsop 2023-08-31 10:47:26 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x