Bug 19388 - Error in course details on OPAC if an item is checked-out
Summary: Error in course details on OPAC if an item is checked-out
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on: 18276
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-29 12:07 UTC by Marijana Glavica
Modified: 2017-10-17 07:29 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19388: FIX display item status if item is checked out (2.05 KB, patch)
2017-09-29 14:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18856 - Cancel Waiting Hold in OPAC does not give useful message (2.46 KB, patch)
2017-09-29 19:14 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 19388: FIX display item status if item is checked out (2.14 KB, patch)
2017-10-06 07:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marijana Glavica 2017-09-29 12:07:58 UTC
In course reserves, if an item which was added to a course is checked out, it is not possible to show details for that course on OPAC. 
The error says: "Template process failed: undef error - The method onsite_checkout is not covered by tests! at /home/koha/src/C4/Templates.pm line 121."
Comment 1 Jonathan Druart 2017-09-29 14:52:53 UTC
Created attachment 67475 [details] [review]
Bug 19388: FIX display item status if item is checked out

In course reserves, if an item which was added to a course is checked
out, it is not possible to show details for that course on OPAC.
The error says: "Template process failed: undef error - The method
onsite_checkout is not covered by tests! at
/home/koha/src/C4/Templates.pm line 121."

onsite_checkout is an attribute of Koha::Checkout, not Koha::Item

Test plan:
Create a course with 2 items that are checked out (standard and on-site)
At the OPAC, add them to your cart and confirm the status of these 2
items is correct
Confirm that on the detail page of the bib record as well as the detail
of the course.
Comment 2 Jonathan Druart 2017-09-29 14:54:15 UTC
Looks like it has been caused by bug 18276.
Comment 3 Caroline Cyr La Rose 2017-09-29 17:51:49 UTC
I tested and it worked. I was able to see the course details.
Comment 4 Caroline Cyr La Rose 2017-09-29 19:14:31 UTC
Created attachment 67485 [details] [review]
Bug 18856 - Cancel Waiting Hold in OPAC does not give useful message

If a hold is 'waiting' for the patron to collect then the patron should be prevented from cancelling the hold via their account in the opac.
If a patron tries to cancel the hold, Koha will give an 'are you sure' alert and when you click Yes the page just refreshes and the hold remains.
Staff can cancel the hold from the staff interface but they can then action the waiting hold.
I think therefore that it is correct behaviour that a patron cannot cancel a hold when it reaches waiting state via the opac but it would be useful to either have a warning to prevent the cancellation or a useful message when they attempt to do so.

The template was using a method that tells Koha if *staff* can cancel a hold,
instead of patron.

Test Plan:
1) Set up a waiting hold
2) Try to cancel it from the opac
3) Note you cannot
4) Apply this patch
5) Reload the page
6) Note the cancel button has disappeared for found holds

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Jonathan Druart 2017-10-04 16:23:55 UTC
Lowering severity, it does not impact stable releases.
Comment 6 Marcel de Rooy 2017-10-06 07:13:18 UTC
Comment on attachment 67485 [details] [review]
Bug 18856 - Cancel Waiting Hold in OPAC does not give useful message

This patch does not belong here
Comment 7 Marcel de Rooy 2017-10-06 07:46:10 UTC
Created attachment 67676 [details] [review]
Bug 19388: FIX display item status if item is checked out

In course reserves, if an item which was added to a course is checked
out, it is not possible to show details for that course on OPAC.
The error says: "Template process failed: undef error - The method
onsite_checkout is not covered by tests! at
/home/koha/src/C4/Templates.pm line 121."

onsite_checkout is an attribute of Koha::Checkout, not Koha::Item

Test plan:
Create a course with 2 items that are checked out (standard and on-site)
At the OPAC, add them to your cart and confirm the status of these 2
items is correct
Confirm that on the detail page of the bib record as well as the detail
of the course.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Jonathan Druart 2017-10-06 15:19:46 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 9 Fridolin SOMERS 2017-10-17 07:29:38 UTC
Depends on Bug 18276 that is not in 17.05.x