Bug 30488: Fix error when placing recall via OPAC
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 7 Apr 2022 22:17:18 +0000 (22:17 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 20 Apr 2022 07:25:50 +0000 (21:25 -1000)
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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Recalls.pm

index e7e360c..ca6bf10 100644 (file)
@@ -164,7 +164,7 @@ sub add_recall {
 
         $item = Koha::Items->find( $itemnumber );
         # add to statistics table
 
         $item = Koha::Items->find( $itemnumber );
         # add to statistics table
-        UpdateStats({
+        C4::Stats::UpdateStats({
             branch => C4::Context->userenv->{'branch'},
             type => 'recall',
             itemnumber => $itemnumber,
             branch => C4::Context->userenv->{'branch'},
             type => 'recall',
             itemnumber => $itemnumber,