Bug 33395 - Patron search results shows only overdues if patron has overdues
Summary: Patron search results shows only overdues if patron has overdues
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: David Nind
QA Contact: Testopia
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-04-03 16:20 UTC by Caroline Cyr La Rose
Modified: 2023-10-17 17:24 UTC (History)
8 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.05,22.11.11


Attachments
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues (2.35 KB, patch)
2023-09-23 01:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues (2.40 KB, patch)
2023-09-24 14:46 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues (2.48 KB, patch)
2023-09-26 10:01 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-04-03 16:20:48 UTC
When you search for patrons, in the results table, there is a Checkouts column.

If the patron has no checkouts, it shows 0 / 0 (0 overdues / 0 total checkouts).

If the patron has checkouts but no overdues, it shows, for example, 0 / 1 (0 overdues / 1 total checkout).

If the patron has only overdues, it shows, for example, only 1 in red (1 overdue ?? total checkouts?).

If the patron has checkouts and overdues, it shows, for example, only 1 in red also (1 overdue ?? total checkouts?)

It's like if there are overdues, the number of checkouts disappear.

To replicate:
1. Make sure SpecifyDueDate is enabled
2. Have 4 patrons (I used 4 patrons with B last names to see them all in one go)
3. Checkout items as follows
   -  Checkout 1 item normally to Patron A
   -  Checkout 1 item to Patron B, specifying a due date in the past
   -  Checkout 1 item normally and 1 item with a past due date to Patron C
   -  Nothing to Patron D
4. Go to Patrons and search for the patrons, making sure there are more than one results
   --> In the results table, the Checkouts column is like this
       Patron A: 0 / 1
       Patron B: 1 (red)
       Patron C: 1 (red)
       Patron D: 0 / 0

For Patron B, it should be (I think?) 1 / 1
For Patron C, it should be (I think?) 1 / 2
Comment 1 Andrew Fuerste-Henry 2023-04-06 15:39:54 UTC
I'm fairly certain this used to display both the checkout count and the overdue count when a patron had overdue items, but I don't have access to an older version on which to confirm this. It looks like bug 30063 (22.05) changed how patron search works, so maybe this behavior changed then?
Comment 2 Andrew Fuerste-Henry 2023-04-06 15:42:34 UTC
Confirmed, this is a regression. The manual for 21.11 contains a screenshot of this screen: https://koha-community.org/manual/21.11/en/html/_images/patronsearchresults.png

And here's the same from the latest manual: https://koha-community.org/manual/latest/en/html/_images/patronsearchresults.png
Comment 3 Caroline Cyr La Rose 2023-04-06 16:07:43 UTC
Thanks Andrew! I was pretty sure both were displayed before, but I didn't go the extra step...
Comment 4 David Nind 2023-09-23 01:54:04 UTC
Created attachment 156127 [details] [review]
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues

This fixes the display of patron search results, so that it shows
the number of checkouts when a patron has overdue items. For
example: 1 / 2

Bug 30063 changed the display to show only the number of overdue
items in bold and red, without the total number of items checked
out.

Test plan:
1. Check out two items to a patron - make one overdue (click the
   checkout setting options and then specify a due date a month
   ago).
2. Check out another item to another patron.
3. Search for patrons so that the two patrons you checked out
   items to are listed in the results.
4. Note the display for the 'Checkouts' column:
   4.1 For patrons without any checkouts: 0 / 0
   4.2 For the patron from step 2 with one checkout: 0 / 1
   4.3 For the patron from step 1 with one overdue and one
       checkout: 1 (in bold and red)
5. Apply the patch.
6. Refresh the page of results (step 3).
7. Note that for the patron from step 1, the display now shows:
   1 / 2 (with the 1 in bold and red).
8. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Lucas Gass 2023-09-24 14:46:13 UTC
Created attachment 156134 [details] [review]
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues

This fixes the display of patron search results, so that it shows
the number of checkouts when a patron has overdue items. For
example: 1 / 2

Bug 30063 changed the display to show only the number of overdue
items in bold and red, without the total number of items checked
out.

Test plan:
1. Check out two items to a patron - make one overdue (click the
   checkout setting options and then specify a due date a month
   ago).
2. Check out another item to another patron.
3. Search for patrons so that the two patrons you checked out
   items to are listed in the results.
4. Note the display for the 'Checkouts' column:
   4.1 For patrons without any checkouts: 0 / 0
   4.2 For the patron from step 2 with one checkout: 0 / 1
   4.3 For the patron from step 1 with one overdue and one
       checkout: 1 (in bold and red)
5. Apply the patch.
6. Refresh the page of results (step 3).
7. Note that for the patron from step 1, the display now shows:
   1 / 2 (with the 1 in bold and red).
8. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Jonathan Druart 2023-09-26 10:01:31 UTC
Created attachment 156210 [details] [review]
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues

This fixes the display of patron search results, so that it shows
the number of checkouts when a patron has overdue items. For
example: 1 / 2

Bug 30063 changed the display to show only the number of overdue
items in bold and red, without the total number of items checked
out.

Test plan:
1. Check out two items to a patron - make one overdue (click the
   checkout setting options and then specify a due date a month
   ago).
2. Check out another item to another patron.
3. Search for patrons so that the two patrons you checked out
   items to are listed in the results.
4. Note the display for the 'Checkouts' column:
   4.1 For patrons without any checkouts: 0 / 0
   4.2 For the patron from step 2 with one checkout: 0 / 1
   4.3 For the patron from step 1 with one overdue and one
       checkout: 1 (in bold and red)
5. Apply the patch.
6. Refresh the page of results (step 3).
7. Note that for the patron from step 1, the display now shows:
   1 / 2 (with the 1 in bold and red).
8. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Tomás Cohen Arazi 2023-10-04 20:43:55 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Fridolin Somers 2023-10-06 00:50:52 UTC
Pushed to 23.05.x for 23.05.05
Comment 9 Matt Blenkinsop 2023-10-17 17:24:28 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x