Bugzilla – Attachment 155245 Details for
Bug 34722
All items display as recalled when an item-level recall is made
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34722: Prevent other items from displaying to fill item-level recalls
Bug-34722-Prevent-other-items-from-displaying-to-f.patch (text/plain), 3.52 KB, created by
Aleisha Amohia
on 2023-09-06 00:21:32 UTC
(
hide
)
Description:
Bug 34722: Prevent other items from displaying to fill item-level recalls
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-09-06 00:21:32 UTC
Size:
3.52 KB
patch
obsolete
>From fa7fb9314a63eb59f67f11adff4beaa79e69e3d7 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 6 Sep 2023 00:13:48 +0000 >Subject: [PATCH] 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 >--- > Koha/Item.pm | 14 ++++++++++++-- > t/db_dependent/Koha/Item.t | 3 ++- > 2 files changed, 14 insertions(+), 3 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 96b5fa8b0f0..1147f6d35d7 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1842,11 +1842,21 @@ sub recall { > }, > { order_by => { -asc => 'created_date' } } > )->as_list; >+ >+ my $item_level_recall; > foreach my $recall (@recalls) { >- if ( $recall->item_level and $recall->item_id == $self->itemnumber ){ >- return $recall; >+ if ( $recall->item_level ) { >+ $item_level_recall = 1; >+ if ( $recall->item_id == $self->itemnumber ){ >+ return $recall; >+ } > } > } >+ if ( $item_level_recall ) { >+ # recall needs to be filled be a specific item only >+ # no other item is relevant to return >+ return; >+ } > # no item-level recall to return, so return earliest biblio-level > # FIXME: eventually this will be based on priority > return $recalls[0]; >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 819f897e0e5..763d57e5f3d 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1848,7 +1848,7 @@ subtest 'store() tests' => sub { > > subtest 'Recalls tests' => sub { > >- plan tests => 22; >+ plan tests => 23; > > $schema->storage->txn_begin; > >@@ -1889,6 +1889,7 @@ subtest 'Recalls tests' => sub { > )->store; > > is( $item1->recall->patron_id, $patron1->borrowernumber, 'Correctly returns most relevant recall' ); >+ is( $item2->recall, undef, 'Other items are not returned for item-level recalls' ); > > $recall2->set_cancelled; > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34722
:
155245
|
155763
|
155765