Bug 30971 - Recalls - log viewer error
Summary: Recalls - log viewer error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 29734
  Show dependency treegraph
 
Reported: 2022-06-15 19:08 UTC by David Nind
Modified: 2023-06-08 22:27 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an error that occurred when viewing recalls log entries. The error was caused by the renaming of itemnumber, biblionumber, and branchcode attributes.
Version(s) released in:
22.11.00, 22.05.01


Attachments
Bug 30971: Recalls log viewer error (2.12 KB, patch)
2022-06-15 19:16 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix one more occurence (1.29 KB, patch)
2022-06-15 19:20 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix recall.branchcode occurences (2.27 KB, patch)
2022-06-15 19:32 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30971: Recalls log viewer error (2.16 KB, patch)
2022-06-15 19:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix one more occurence (1.34 KB, patch)
2022-06-15 19:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix recall.branchcode occurences (2.37 KB, patch)
2022-06-15 19:49 UTC, David Nind
Details | Diff | Splinter Review
Bug 30971: Recalls log viewer error (2.23 KB, patch)
2022-06-16 09:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix one more occurence (1.41 KB, patch)
2022-06-16 09:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30971: (follow-up) Fix recall.branchcode occurences (2.38 KB, patch)
2022-06-16 10:00 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 David Nind 2022-06-15 19:08:06 UTC
There is an error in the log viewer when displaying the recalls logs on the screen (exporting to a file works though):

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
.....

To replicate:
1. Enable recalls: set UseRecalls system preference to 'Use'.
2. Ensure the RecallsLog system preference is set to 'Log'.
3. Setup recalls 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).
Comment 1 Tomás Cohen Arazi 2022-06-15 19:16:01 UTC
Created attachment 136118 [details] [review]
Bug 30971: Recalls log viewer error

This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2022-06-15 19:20:37 UTC
Created attachment 136119 [details] [review]
Bug 30971: (follow-up) Fix one more occurence

To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2022-06-15 19:32:50 UTC
Created attachment 136120 [details] [review]
Bug 30971: (follow-up) Fix recall.branchcode occurences

This fixes a couple cases actually.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 David Nind 2022-06-15 19:35:03 UTC
Created attachment 136121 [details] [review]
Bug 30971: Recalls log viewer error

This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2022-06-15 19:35:08 UTC
Created attachment 136122 [details] [review]
Bug 30971: (follow-up) Fix one more occurence

To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2022-06-15 19:35:50 UTC
Thanks Tomás!

There are no more occurrences of the git grep queries after the patches are applied, and the log viewer now works for recalls.

David
Comment 7 Tomás Cohen Arazi 2022-06-15 19:41:57 UTC
(In reply to David Nind from comment #6)
> Thanks Tomás!
> 
> There are no more occurrences of the git grep queries after the patches are
> applied, and the log viewer now works for recalls.
> 
> David

David, thanks to you. I also did this:

Generated a 'recalls' file:
$ cat recalls
borrowernumber
recalldate
biblionumber
branchcode
cancellationdate
recallnotes
itemnumber
waitingdate
expirationdate
old
item_level_recall

and then:

$ for i in $(cat ~/recalls) ; do \
       git grep "recall\.$i" | grep -v translator; \
       git grep "recall\->$i" | grep -v translator; \
  done

And no more results. Chances are that in some places variables could've been named differently. Hopefully QA didn't allow that :-D
Comment 8 Tomás Cohen Arazi 2022-06-15 19:46:21 UTC
(In reply to David Nind from comment #6)
> Thanks Tomás!
> 
> There are no more occurrences of the git grep queries after the patches are
> applied, and the log viewer now works for recalls.
> 
> David

You missed one of the patches to SO
Comment 9 David Nind 2022-06-15 19:49:58 UTC
Created attachment 136123 [details] [review]
Bug 30971: (follow-up) Fix recall.branchcode occurences

This fixes a couple cases actually.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

https://bugs.koha-community.org/show_bug.cgi?id=30917
Comment 10 David Nind 2022-06-15 19:50:48 UTC
(In reply to Tomás Cohen Arazi from comment #8)
> You missed one of the patches to SO

I was too quick! Now signed off as well.
Comment 11 Martin Renvoize 2022-06-16 09:59:55 UTC
Created attachment 136139 [details] [review]
Bug 30971: Recalls log viewer error

This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2022-06-16 09:59:59 UTC
Created attachment 136140 [details] [review]
Bug 30971: (follow-up) Fix one more occurence

To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2022-06-16 10:00:03 UTC
Created attachment 136141 [details] [review]
Bug 30971: (follow-up) Fix recall.branchcode occurences

This fixes a couple cases actually.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2022-06-16 10:00:35 UTC
All works as expected now, thanks for following through on all this Tomas.

PQA
Comment 15 Tomás Cohen Arazi 2022-06-16 12:49:08 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 16 Lucas Gass 2022-06-24 16:53:09 UTC
backported to 22.05.x for 22.05.01