Bugzilla – Attachment 145831 Details for
Bug 32712
OPACShowCheckoutName makes OPAC explode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled
Bug-32712-Fix-OPAC-breakage-when-OPACShowCheckoutN.patch (text/plain), 4.05 KB, created by
Lucas Gass (lukeg)
on 2023-01-30 23:05:53 UTC
(
hide
)
Description:
Bug 32712: Fix OPAC breakage when OPACShowCheckoutName enabled
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-01-30 23:05:53 UTC
Size:
4.05 KB
patch
obsolete
>From 1f44b6d40f09322cd3c852effe63db0896655273 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 30 Jan 2023 17:08:36 -0300 >Subject: [PATCH] Bug 32712: Fix OPAC breakage when OPACShowCheckoutName > enabled > >Bug 31313 removed GetItemsInfo and proper Koha::Object-based objects are >passed now. But some automatic search & replace kept patron-related >attributes incorrectly linked to Koha::Item. > >This patch makes the item-status.inc file reuse the checkout object and >get the linked patron to gather the required information. Some >simplification is done on hte same patch... should be trivial. > >To test: >1. Have OpacShowCheckoutName enabled >2. Pick a biblio with items (all of them not checkecd-out) >3. Open the OPAC detail view for the biblio >=> SUCCESS: You see the biblio and the items >4. Check one of the items out >5. Refresh the OPAC page >=> FAIL: The page explodes! >6. Apply this patch >7. Refresh the OPAC page >=> SUCCESS: You see the biblio and the items, the patron info is >correctly displayed. >8. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../bootstrap/en/includes/item-status.inc | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 0573b90e068..305282861c9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -19,9 +19,10 @@ > [% SET transfertto = transfer.tobranch %] > [% END %] > >-[% SET waiting = item.holds.waiting.count %] >+[% SET checkout = item.checkout %] >+[% SET waiting = item.holds.waiting.count %] > [% IF include_schema_org %] >- [% IF item.damaged or item.checkout.date_due or item.itemlost or transfertwhen or waiting %] >+ [% IF item.damaged or checkout or item.itemlost or transfertwhen or waiting %] > <link property="availability" href="http://schema.org/OutOfStock" /> > [% ELSIF item.withdrawn %] > <link property="availability" href="http://schema.org/Discontinued" /> >@@ -42,26 +43,26 @@ > [% END %] > [% END %] > >-[% SET datedue = item.checkout.date_due %] >-[% SET onsite_checkout = item.checkout.onsite_checkout %] >+[% IF checkout %] >+ [% SET checkout_patron = checkout.patron %] >+ [% SET onsite_checkout = checkout.onsite_checkout %] > >-[% IF datedue %] > [% SET itemavailable = 0 %] > [% IF onsite_checkout %] > [% IF ( OPACShowCheckoutName ) %] >- <span class="item-status checkedout">Currently in local use by [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> >+ <span class="item-status checkedout">Currently in local use by [% checkout_patron.firstname | html %] [% checkout_patron.surname | html %] [% IF ( checkout_patron.cardnumber ) %]([% checkout_patron.cardnumber | html %])[% END %]</span> > [% ELSE %] > <span class="item-status checkedout">Currently in local use</span> > [% END %] > [% ELSE %] > [% IF ( OPACShowCheckoutName ) %] >- <span class="item-status checkedout">Checked out to [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span> >+ <span class="item-status checkedout">Checked out to [% checkout_patron.firstname | html %] [% checkout_patron.surname | html %] [% IF ( checkout_patron.cardnumber ) %]([% checkout_patron.cardnumber | html %])[% END %]</span> > [% ELSE %] > <span class="item-status checkedout">Checked out</span> > [% END %] > [% END %] > [% IF show_recall_link %] >- [% IF datedue && logged_in_user.borrowernumber != issue.borrowernumber %] >+ [% IF logged_in_user.borrowernumber != issue.borrowernumber %] > <a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a> > [% END %] > [% END %] >-- >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 32712
:
145808
|
145831
|
145832
|
145840
|
145841
|
145847
|
146014