Bugzilla – Attachment 142790 Details for
Bug 32037
Circulation module in action logs has bad links for deleted items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32037: Check for existence of object before building link
Bug-32037-Check-for-existence-of-object-before-bui.patch (text/plain), 6.33 KB, created by
David Nind
on 2022-10-28 20:47:30 UTC
(
hide
)
Description:
Bug 32037: Check for existence of object before building link
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-10-28 20:47:30 UTC
Size:
6.33 KB
patch
obsolete
>From dd30878d6a74329f18975a335ed7bd4f30507176 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 <david@davidnind.com> >--- > .../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 ac37c1996d..9bf9f915e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -391,24 +391,22 @@ > [% END %] > </td> > <td> >- [% IF ( loopro.module == 'CIRCULATION' ) %] >+ [% IF ( loopro.module == 'CIRCULATION' && loopro.object_found ) %] > <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% loopro.info | uri %]&biblionumber=[% loopro.biblionumber | uri %]&bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.info | uri %]" title="Display detail for this item">Item [% loopro.barcode | html %]</a> >+ [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %] >+ <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div> >+ <div class="compare_info" id="compare_info[% loopro.action_id | html %]"> >+ <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% FOREACH info IN loopro.info.split(' \| ') %][% IF loop.first %][% info | html %][% END %][% END %]" class="compare" /> Compare</label> >+ </div> >+ [% ELSIF loopro.module == "NOTICES" %] >+ <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div> >+ <div class="compare_info" id="compare_info[% loopro.action_id | html %]"> >+ <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% IF loopro.notice %][% loopro.notice.title | html %][% ELSE %][% loopro.object | html %][% END %]" class="compare" /> Compare</label> >+ </div> > [% ELSE %] >- [% IF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %] >- <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div> >- <div class="compare_info" id="compare_info[% loopro.action_id | html %]"> >- <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% FOREACH info IN loopro.info.split(' \| ') %][% IF loop.first %][% info | html %][% END %][% END %]" class="compare" /> Compare</label> >- </div> >- [% ELSIF loopro.module == "NOTICES" %] >- <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div> >- <div class="compare_info" id="compare_info[% loopro.action_id | html %]"> >- <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% IF loopro.notice %][% loopro.notice.title | html %][% ELSE %][% loopro.object | html %][% END %]" class="compare" /> Compare</label> >- </div> >- [% ELSE %] >- <div class="loginfo" id="loginfo[% loopro.action_id | html %]"> >- [% loopro.info | html %] >- </div> >- [% END %] >+ <div class="loginfo" id="loginfo[% loopro.action_id | html %]"> >+ [% loopro.info | html %] >+ </div> > [% END %] > </td> > <td>[% PROCESS translate_log_interface log_interface=loopro.interface %]</td> >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index 49eeb5decc..9db4e430ed 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -157,6 +157,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.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32037
:
142775
|
142790
|
143021