Bug 30488

Summary: Error when placing a recall in the OPAC
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: blocker    
Priority: P1 - high CC: aleisha, alexbuckley, fridolin.somers, jonathan.druart, kyle, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Circulation function:
Bug Depends on: 19532    
Bug Blocks:    
Attachments: Bug 30488: Fix error when placing recall via OPAC
Bug 30488: Fix error when placing recall via OPAC
Bug 30488: Fix error when placing recall via OPAC

Description Owen Leonard 2022-04-07 13:44:50 UTC
I'm getting an error when placing a recall from the OPAC. It appears at the last stage, after clicking the submit button to place the recall.

Validation failed for type named Month declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.28/DateTime/Types.pm) at line 119 in sub named (eval) with value 29
Comment 1 Aleisha Amohia 2022-04-07 22:26:10 UTC
Created attachment 133095 [details] [review]
Bug 30488: Fix error when placing recall via OPAC

This error occurs due to how UpdateStats is called in Koha/Recalls.pm

To test:
1) Enable the UseRecalls system preference and set some random values in
the recalls circulation and fines rules.
2) Find or create an item. Check this item out to Patron A.
3) Log in to the OPAC as Patron B.
4) Find the item you checked out to Patron A. Click the button to place
a recall.
5) Fill out whatever details you like. Click the Submit button. This
should trigger the error.
6) Apply the patch and refresh the page.
7) Confirm the recall has now been requested successfully.

Sponsored-by: Catalyst IT
Comment 2 Owen Leonard 2022-04-11 10:52:14 UTC
Created attachment 133148 [details] [review]
Bug 30488: Fix error when placing recall via OPAC

This error occurs due to how UpdateStats is called in Koha/Recalls.pm

To test:
1) Enable the UseRecalls system preference and set some random values in
the recalls circulation and fines rules.
2) Find or create an item. Check this item out to Patron A.
3) Log in to the OPAC as Patron B.
4) Find the item you checked out to Patron A. Click the button to place
a recall.
5) Fill out whatever details you like. Click the Submit button. This
should trigger the error.
6) Apply the patch and refresh the page.
7) Confirm the recall has now been requested successfully.

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Marcel de Rooy 2022-04-15 06:57:43 UTC
(In reply to Owen Leonard from comment #0)
> I'm getting an error when placing a recall from the OPAC. It appears at the
> last stage, after clicking the submit button to place the recall.
> 
> Validation failed for type named Month declared in package DateTime::Types
> (/usr/lib/x86_64-linux-gnu/perl5/5.28/DateTime/Types.pm) at line 119 in sub
> named (eval) with value 29

I'm crashing too but the error described does not come up. Instead I see:

Use of inherited AUTOLOAD for non-method Koha::Recalls::UpdateStats() is no longer allowed at /usr/share/koha/Koha/Recalls.pm line 168

And this message fits the suggested solution better ;)
Comment 4 Marcel de Rooy 2022-04-15 06:59:22 UTC
Created attachment 133341 [details] [review]
Bug 30488: Fix error when placing recall via OPAC

This error occurs due to how UpdateStats is called in Koha/Recalls.pm

To test:
1) Enable the UseRecalls system preference and set some random values in
the recalls circulation and fines rules.
2) Find or create an item. Check this item out to Patron A.
3) Log in to the OPAC as Patron B.
4) Find the item you checked out to Patron A. Click the button to place
a recall.
5) Fill out whatever details you like. Click the Submit button. This
should trigger the error.
6) Apply the patch and refresh the page.
7) Confirm the recall has now been requested successfully.

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Fridolin Somers 2022-04-20 07:24:11 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑