Bugzilla – Attachment 152160 Details for
Bug 33957
normalized_oclc not defined in opac-user.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33957: Add normalized_oclc and only fetch when needed
Bug-33957-Add-normalizedoclc-and-only-fetch-when-n.patch (text/plain), 2.72 KB, created by
Nick Clemens (kidclamp)
on 2023-06-08 11:20:33 UTC
(
hide
)
Description:
Bug 33957: Add normalized_oclc and only fetch when needed
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-06-08 11:20:33 UTC
Size:
2.72 KB
patch
obsolete
>From 51641e5baba9ac147f213745e0b1fd21e8e718f6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 8 Jun 2023 11:15:27 +0000 >Subject: [PATCH] Bug 33957: Add normalized_oclc and only fetch when needed > >opac-user.tt wants to normalized_oclc number if using syndetics or B&T images > >We don't need to fetch it if not, but we need to pass it if so > >To test: >1 - Switch all Syndetics prefs to 'Show' or 'Use' except > SyndeticsClientCode = just enter 'test' >2 - Checkout some items to a patron, ensure the records have: > - ISBN > - UPC > - OCLC number >3 - View opac-user.pl (sign in to opac as the user) >4 - View the network console tab (may need to reload) >5 - Note requests like: > https://secure.syndetics.com/index.aspx?isbn=1780335792/MC.GIF&client=test&type=xw10&upc=&oclc= >6 - Note that oclc parameter is not filled for record with an oclc number >7 - Apply patch >8 - Reload >9 - Confirm the link now has oclc as expected >10 - Disable syndetics, enable google books or another source >11 - Confirm images display as expected >--- > opac/opac-user.pl | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index e65a3ce49b..ac31668e1a 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -27,6 +27,7 @@ use C4::Koha qw( > getitemtypeimagelocation > GetNormalizedISBN > GetNormalizedUPC >+ GetNormalizedOCLCNumber > ); > use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges ); > use C4::External::BakerTaylor qw( image_url link_url ); >@@ -296,9 +297,15 @@ if ( $pending_checkouts->count ) { # Useless test > > my $isbn = GetNormalizedISBN($issue->{'isbn'}); > $issue->{normalized_isbn} = $isbn; >- my $marcrecord = $biblio_object->metadata->record({ embed_items => 1, opac => 1, patron => $patron,}); >- $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') ); > >+ if ( C4::Context->preference('BakerTaylorEnabled') >+ || C4::Context->preference('SyndeticsEnabled') >+ || C4::Context->preference('SyndeticsCoverImages') ) >+ { >+ my $marcrecord = $biblio_object->metadata->record({ embed_items => 1, opac => 1, patron => $patron,}); >+ $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') ); >+ $issue->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord, C4::Context->preference('marcflavour')); >+ } > # My Summary HTML > if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ > $issue->{author} ? $my_summary_html =~ s/{AUTHOR}/$issue->{author}/g : $my_summary_html =~ s/{AUTHOR}//g; >-- >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 33957
:
152160
|
152193