Bug 30886 - Recall status cannot be correct on OPAC detail page
Summary: Recall status cannot be correct on OPAC detail page
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Aleisha Amohia
QA Contact: Katrin Fischer
URL:
Keywords: RM_priority
Depends on: 19532
Blocks: 27272 29734
  Show dependency treegraph
 
Reported: 2022-06-02 10:23 UTC by Jonathan Druart
Modified: 2022-06-21 13:46 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.01


Attachments
Bug 30886: Show pending recall on item on OPAC (3.25 KB, patch)
2022-06-02 23:04 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 30886: Show pending recall on item on OPAC (3.14 KB, patch)
2022-06-03 04:05 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 30886: Show pending recall on item on OPAC (3.19 KB, patch)
2022-06-03 21:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 30886: Show pending recall on item on OPAC (3.24 KB, patch)
2022-06-06 10:48 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-06-02 10:23:25 UTC
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.
Comment 1 Aleisha Amohia 2022-06-02 23:04:06 UTC
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
Comment 2 Aleisha Amohia 2022-06-03 04:05:38 UTC
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
Comment 3 David Nind 2022-06-03 21:43:41 UTC
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>
Comment 4 David Nind 2022-06-03 21:51:41 UTC
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.
Comment 5 Katrin Fischer 2022-06-06 10:48:54 UTC
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>
Comment 6 Tomás Cohen Arazi 2022-06-06 14:38:36 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass 2022-06-15 16:15:47 UTC
Pushed to 22.05.x for 22.05.01
Comment 8 Arthur Suzuki 2022-06-21 13:46:47 UTC
depends on recalls, not relevant for 21.11. Won't backport