From 7d1aa6892e408136bdc30e27cc21141877adf534 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 28 Oct 2022 14:43:10 +0000 Subject: [PATCH] Bug 32037: Check for existence of object before building link This patch adds a check on the existence of the object and passes this to the template I also drop a level of IF by moving to ELSIF To test: 1 - Enable ReturnLog amd IssueLog 2 - Checkout an item to a patron 3 - Return it 4 - View 'Modification log' tab of the borrwer 5 - Note item links, test them, they work 6 - Delete the item 7 - Reload and try links again, they do not work 8 - Apply patch 9 - Reload, no more links 10 - Checkout and return another item 11 - This one has links, and they work as before Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 03c8725b4e253faf87ca3aeda71ce8b59d4efdb0) Signed-off-by: Lucas Gass (cherry picked from commit 21d01baebcdacfb16c1fbd9ee0bb1a05d3c5837b) Signed-off-by: Arthur Suzuki --- .../prog/en/modules/tools/viewlog.tt | 30 +++++++++---------- tools/viewlog.pl | 1 + 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index 2f4ad0629e..4285f92017 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -370,24 +370,22 @@ [% END %] - [% IF ( loopro.module == 'CIRCULATION' ) %] + [% IF ( loopro.module == 'CIRCULATION' && loopro.object_found ) %] Item [% loopro.barcode | html %] + [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %] +
[% loopro.info | trim | html %]
+
+ +
+ [% ELSIF loopro.module == "NOTICES" %] +
[% loopro.info | trim | html %]
+
+ +
[% ELSE %] - [% IF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %] -
[% loopro.info | trim | html %]
-
- -
- [% ELSIF loopro.module == "NOTICES" %] -
[% loopro.info | trim | html %]
-
- -
- [% ELSE %] -
- [% loopro.info | html %] -
- [% END %] +
+ [% loopro.info | html %] +
[% END %] [% PROCESS translate_log_interface log_interface=loopro.interface %] diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 773df31a2e..2a7f750e5c 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -156,6 +156,7 @@ if ($do_it) { $itemnumber = $log->info if ( $log->module eq "CIRCULATION" ); my $item = Koha::Items->find($itemnumber); if ($item) { + $result->{'object_found'} = 1; $result->{'biblionumber'} = $item->biblionumber; $result->{'biblioitemnumber'} = $item->biblionumber; $result->{'barcode'} = $item->barcode; -- 2.39.5