734 my $recall_status; 735 if ( C4::Context->preference('UseRecalls') ) { 736 my $recall_status = Koha::Recalls->search( 737 { 738 item_id => $itm->{itemnumber}, 739 status => 'waiting', 740 completed => undef, 741 } 742 )->count; 743 } Extra "my" here.
Created attachment 135635 [details] [review] Bug 30886: Show pending recall on item on OPAC The 'completed' flag was causing the wrong status to be shown, but we can also give a more useful message to the patron. To test: 1) Enable the UseRecalls system preference and set up your recalls-related circulation rules. 2) Check out an item to Patron B. 3) Log into the OPAC as Patron A and search for the item. 4) Place a recall on that item. 5) Go back to the staff client and check the item in. Confirm the recall as waiting for Patron A. 6) Go back to the OPAC record page and look at the holdings table. Notice the status still says the item is Available. 7) Apply patch, restart services, refresh the OPAC. 8) Confirm the holdings table status now says the item has a pending recall. Sponsored-by: Catalyst IT
Created attachment 135636 [details] [review] Bug 30886: Show pending recall on item on OPAC The 'completed' flag was causing the wrong status to be shown, but we can also give a more useful message to the patron. To test: 1) Enable the UseRecalls system preference and set up your recalls-related circulation rules. 2) Check out an item to Patron B. 3) Log into the OPAC as Patron A and search for the item. 4) Place a recall on that item. 5) Go back to the staff client and check the item in. Confirm the recall as waiting for Patron A. 6) Go back to the OPAC record page and look at the holdings table. Notice the status still says the item is Available. 7) Apply patch, restart services, refresh the OPAC. 8) Confirm the holdings table status now says the item has a pending recall. Sponsored-by: Catalyst IT
Created attachment 135695 [details] [review] Bug 30886: Show pending recall on item on OPAC The 'completed' flag was causing the wrong status to be shown, but we can also give a more useful message to the patron. To test: 1) Enable the UseRecalls system preference and set up your recalls-related circulation rules. 2) Check out an item to Patron B. 3) Log into the OPAC as Patron A and search for the item. 4) Place a recall on that item. 5) Go back to the staff client and check the item in. Confirm the recall as waiting for Patron A. 6) Go back to the OPAC record page and look at the holdings table. Notice the status still says the item is Available. 7) Apply patch, restart services, refresh the OPAC. 8) Confirm the holdings table status now says the item has a pending recall. Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using koha-testing-docker): 1. Not that this is in the test plan, but if you view the detail page for the record in the staff interface, you get this error: Template process failed: undef error - The method Koha::Recall->waitingdate is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Object.pm line 875 Koha::Object::AUTOLOAD('Koha::Recall=HASH(0x559a26d7a8a0)') called at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt line 522 eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt line 522 eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt line 633 2. This is fixed when bug 30876 and bug 30885 are applied.
Created attachment 135718 [details] [review] Bug 30886: Show pending recall on item on OPAC The 'completed' flag was causing the wrong status to be shown, but we can also give a more useful message to the patron. To test: 1) Enable the UseRecalls system preference and set up your recalls-related circulation rules. 2) Check out an item to Patron B. 3) Log into the OPAC as Patron A and search for the item. 4) Place a recall on that item. 5) Go back to the staff client and check the item in. Confirm the recall as waiting for Patron A. 6) Go back to the OPAC record page and look at the holdings table. Notice the status still says the item is Available. 7) Apply patch, restart services, refresh the OPAC. 8) Confirm the holdings table status now says the item has a pending recall. Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 22.11. Nice work everyone, thanks!
Pushed to 22.05.x for 22.05.01
depends on recalls, not relevant for 21.11. Won't backport