Bug 39962 - Recalled status does not show properly on staff interface record detail page
Summary: Recalled status does not show properly on staff interface record detail page
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on: 38512
Blocks:
  Show dependency treegraph
 
Reported: 2025-05-21 22:18 UTC by Aleisha Amohia
Modified: 2025-05-30 20:58 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the holdings table for a record with recalls in the staff interface - it now correctly shows that a recall was placed for record-level and item-level recalls. Before this change: - For record-level recalls, the recall status was not shown. - For item-level recalls, the recall status was shown twice.
Version(s) released in:
Circulation function: Recalls


Attachments
Bug 39962: Allocate item to bib-level recall when checkout chosen (4.52 KB, patch)
2025-05-28 02:28 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 39962: Allocate checkout item to current recalls (2.65 KB, patch)
2025-05-28 03:49 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 39962: Allocate item to bib-level recall when checkout chosen (4.57 KB, patch)
2025-05-30 20:51 UTC, David Nind
Details | Diff | Splinter Review
Bug 39962: Allocate checkout item to current recalls (2.69 KB, patch)
2025-05-30 20:51 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2025-05-21 22:18:45 UTC
To reproduce:

1. Enable the UseRecalls system preference and set the recalls-related circulation and fines rules.
2. Search for an item.
3. Check out an item to Patron B.
4. Log into the OPAC as Patron A.
5. Request a record-level recall on the record.
6. View the record on the staff interface and look at the holdings table. Notice that the checked out item shows no indication of being recalled, but the recall request does show on the Recalls tab. --> BUG
7. Go to the Recalls tab and cancel the recall.
8. Go back to the OPAC and request an item-level recall on the checked out item.
9. View the record on the staff interface and look at the holdings table. Notice that the checked out item now shows the recalled status, twice. "Recalled by koha (42) on DATE" --> BUG
Comment 1 Aleisha Amohia 2025-05-27 21:59:49 UTC
Looks like this was caused by Bug 38512 - item-level recalls display as expected, but biblio-level recalls don't indicate who the return notice was sent to.
Comment 2 Aleisha Amohia 2025-05-28 02:28:59 UTC
Created attachment 182807 [details] [review]
Bug 39962: Allocate item to bib-level recall when checkout chosen

When a biblio-level recall is requested, the checkout with the oldest due date is chosen to have its due date adjusted and sent a return notice. However the chosen checkout item isn't assigned to the recall. This makes it hard for Koha to know which item to show as 'recalled' on the biblio detail page.

This patch allocates the checked out item that gets chosen for the recall by oldest due date, to the recall in the database.

This patch then checks if the item has an attached recall to display recall information on the biblio detail page, rather than checking for if the UseRecalls system preference is enabled.

To test:
1) Enable the UseRecalls system preference and set recalls-related circulation rules.
2) Find a record with at least one item
3) Check out an item in this record to Patron B
4) Log into the OPAC as Patron A and place a biblio-level recall on the record
5) View the record on the staff interface and look at the holdings table
6) The checked out item should now also show a message that it is recalled.
7) Cancel the recall
8) Go back to the OPAC as Patron A and this time place an item-level recall on the checked out item
9) View the record on the staff interface and confirm the recall message shows as expected
10) Confirm all tests pass t/db_dependent/Koha/Item.t , t/db_dependent/Koha/Recalls.t , t/db_dependent/Koha/Plugins/Recall_hooks.t

Sponsored-by: Auckland University of Technology
Comment 3 Aleisha Amohia 2025-05-28 03:49:55 UTC
Created attachment 182808 [details] [review]
Bug 39962: Allocate checkout item to current recalls

1. Set up a recall before applying both of these patches
2. Apply the first patch and notice that the recall still doesn't show, because it was created before the patch was applied
3. Apply this patch, install database updates and restart services
4. Notice your old recall now shows as requested and was allocated the relevant checkout item

Sponsored-by: Auckland University of Technology
Comment 4 David Nind 2025-05-30 20:51:11 UTC
Created attachment 182866 [details] [review]
Bug 39962: Allocate item to bib-level recall when checkout chosen

When a biblio-level recall is requested, the checkout with the oldest due date is chosen to have its due date adjusted and sent a return notice. However the chosen checkout item isn't assigned to the recall. This makes it hard for Koha to know which item to show as 'recalled' on the biblio detail page.

This patch allocates the checked out item that gets chosen for the recall by oldest due date, to the recall in the database.

This patch then checks if the item has an attached recall to display recall information on the biblio detail page, rather than checking for if the UseRecalls system preference is enabled.

To test:
1) Enable the UseRecalls system preference and set recalls-related circulation rules.
2) Find a record with at least one item
3) Check out an item in this record to Patron B
4) Log into the OPAC as Patron A and place a biblio-level recall on the record
5) View the record on the staff interface and look at the holdings table
6) The checked out item should now also show a message that it is recalled.
7) Cancel the recall
8) Go back to the OPAC as Patron A and this time place an item-level recall on the checked out item
9) View the record on the staff interface and confirm the recall message shows as expected
10) Confirm all tests pass t/db_dependent/Koha/Item.t , t/db_dependent/Koha/Recalls.t , t/db_dependent/Koha/Plugins/Recall_hooks.t

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2025-05-30 20:51:13 UTC
Created attachment 182867 [details] [review]
Bug 39962: Allocate checkout item to current recalls

1. Set up a recall before applying both of these patches
2. Apply the first patch and notice that the recall still doesn't show, because it was created before the patch was applied
3. Apply this patch, install database updates and restart services
4. Notice your old recall now shows as requested and was allocated the relevant checkout item

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>