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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 4 Oct 2023 20:40:17 +0000 (16:40 -0400)
commitbe375ed01ce997817b23bbd219b05033ac1c35e7
tree566fdb2e10ff00d67e9234971b4cd5afedcf1288
parenta6ba086a92115af5e43c84eb4e8dc8dbe2422ff7
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>
Koha/Item.pm
t/db_dependent/Koha/Item.t