Bug 34722: Prevent other items from displaying to fill item-level recalls
authorAleisha Amohia <aleishaamohia@hotmail.com>
Wed, 6 Sep 2023 00:13:48 +0000 (00:13 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 6 Oct 2023 00:56:34 +0000 (14:56 -1000)
commit60d5a6f0fb3ef719d376e95c38815c4820fb1043
treef55e8c669d541792989229b936207957bac3b1aa
parent65f3c1d48eccd9682e7f8ecf3f18587ddf2ad1d9
Bug 34722: Prevent other items from displaying to fill item-level recalls

This patch prevents other items attached to a record from being displayed as 'recalled' by item-level recalls.

To test:
1. Ensure UseRecalls system preference is enabled and circulation rules relevant to recalls are configured. Set 'on shelf recalls allowed' circulation rule 'if any unavailable' for ease of testing.
2. Search for a record that has multiple items, or create one with multiple items. Check out two of the items (Item A and Item B) to a patron, Patron A.
3. Log into the OPAC as another patron, Patron B. Search for the record and place a recall. Choose to recall a specific item and select Item A.
4. Go back to the staff interface and view the catalogue detail page for the record. Notice that every item has a 'recalled by...' message, even though Item A was specifically recalled.
5. Log into the OPAC as another patron, Patron C. Search for the record and place a recall. Choose to recall a specific item, notice every item has a 'recalled by...' message. Select Item B and Confirm.
6. In your terminal, the 'Other items are not returned for item-level recalls' test should fail when running
prove t/db_dependent/Koha/Item.t

7. Apply the patch and restart services

8. Confirm tests at t/db_dependent/Koha/Item.t now pass
9. Refresh the staff interface, confirm only Items A and B have the recalled message and the recall patron information for each item is accurate
10. Log into the OPAC as another patron, Patron D. Search for the record and place a recall. Choose to recall a specific item. Confirm only Items A and B have the recalled message.

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Perltidied new code.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit be375ed01ce997817b23bbd219b05033ac1c35e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Item.pm
t/db_dependent/Koha/Item.t