Bug 30907 - Remaining incorrect uses of Koha::Recall->item_level_recall
Summary: Remaining incorrect uses of Koha::Recall->item_level_recall
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low critical (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 19532
Blocks: 29734 30924
  Show dependency treegraph
 
Reported: 2022-06-06 10:44 UTC by Katrin Fischer
Modified: 2023-06-08 22:32 UTC (History)
9 users (show)

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


Attachments
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall (2.42 KB, patch)
2022-06-09 13:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall (2.49 KB, patch)
2022-06-09 14:19 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-06-06 10:44:19 UTC
When an item on the patron account was recalled, the list of checkouts in the patron account in the staff interface doesn't load:

XHRGEThttp://localhost:8081/cgi-bin/koha/svc/checkouts?borrowernumber=19&_=1654512131603
[HTTP/1.1 500 Internal Server Error 223ms]

The method Koha::Recall->item_level_recall is not covered by tests!


I have tried with several of the other recall fixes applied, but couldn't get this to go away. If it's a duplicate please close.
Comment 1 Jonathan Druart 2022-06-07 09:49:11 UTC
The column has been renamed "item_level"

Those two occurrences need to be adjusted:

koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt:                                            [% IF loopro.recall.item_level_recall %]

svc/checkouts:            if ( $recall->item_level_recall ) {
Comment 2 Tomás Cohen Arazi 2022-06-09 13:26:35 UTC
Created attachment 135882 [details] [review]
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall

This attribute name was changed to *item_level* but this two remaining
places kept calling it with the old name.

To test, verify things don't explode when looking at checkouts with
recalls and also in the log viewer.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Martin Renvoize 2022-06-09 14:19:32 UTC
Created attachment 135885 [details] [review]
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall

This attribute name was changed to *item_level* but this two remaining
places kept calling it with the old name.

To test, verify things don't explode when looking at checkouts with
recalls and also in the log viewer.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2022-06-09 14:19:56 UTC
No other occurrences found.. passing QA
Comment 5 Tomás Cohen Arazi 2022-06-09 14:25:50 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 David Nind 2022-06-10 15:38:13 UTC
For me, the log viewer is still exploding (using koha-testing-docker - this patch is now in master, everything updated) - unless this is a different cause of the error:

1. Enable recalls: set UseRecalls system preference to 'Use'.
2. Ensure recalls RecallsLog system preference is set to 'Log'.
3. Setup rcalls circulation and fines rules:
  . Recalls allowed (total) = 5
  . Recalls per record (count) = 2
  . On shelf recalls allowed = 'If any unavailable'
  . Recall due date interval (day) = 3
  . Recall overdue fine amount = 5
  . Recall pickup period (day) = 2
4. Checkout an item to a patron:
   - Patron used: Mary Burton (Midway)
   - Record used: Programming Perl (biblionumber = 262, one item = 39999000011418, home library = Centerville)
5. Change username/password for a patron and login to the OPAC and place a recall for the item in step 4.
   - Patron used: Henry Acevedo (Midway)
6. View the checkout and details tab for patron used in step 4:
   . List of checkouts should display correctly
   . Message in the title column for the item with a recall: This item has been recalled and the due date updated.
7. Go to Tools > Log viewer and press submit (can limit the module to just Recalls if you wish).
8. Error generated:

Template process failed: undef error - The method Koha::Recall->biblionumber is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Object.pm line 875
Koha::Object::AUTOLOAD('Koha::Recall=HASH(0x55da45a77358)') called at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt line 385
eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt line 385
eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt line 409
eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt line 18
Template::Provider::__ANON__('Template::Context=HASH(0x55da45d16528)') called at /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Document.pm line 163
eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.32/Template/Document.pm line 161
Templ
.....
Comment 7 David Nind 2022-06-15 19:12:10 UTC
(In reply to David Nind from comment #6)
> For me, the log viewer is still exploding (using koha-testing-docker - this
> patch is now in master, everything updated) - unless this is a different
> cause of the error:

Have added bug 30971 for this issue.
Comment 8 Lucas Gass 2022-06-24 15:57:31 UTC
Backported to 22.05.x for 22.05.01