Bugzilla – Attachment 56391 Details for
Bug 17250
Koha::AuthorisedValues - Remove GetAuthValCode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 17250: Do not retrieve marc subfield structure when the authorised value is not defined
PASSED-QA-Bug-17250-Do-not-retrieve-marc-subfield-.patch (text/plain), 8.07 KB, created by
Martin Renvoize (ashimema)
on 2016-10-13 13:00:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 17250: Do not retrieve marc subfield structure when the authorised value is not defined
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2016-10-13 13:00:59 UTC
Size:
8.07 KB
patch
obsolete
>From 7803cffac0da79206ff18a3177345df80113a8a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Oct 2016 13:48:09 +0100 >Subject: [PATCH] [PASSED QA] Bug 17250: Do not retrieve marc subfield > structure when the authorised value is not defined > >GetAuthValCode did not return anything if the authorised_value column >was not defined. Our new calls to Koha::MarcSubfieldStructures->search >should behave the same > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Search.pm | 2 +- > catalogue/detail.pl | 6 +++--- > catalogue/itemsearch.pl | 6 +++--- > catalogue/moredetail.pl | 12 ++++++------ > circ/circulation.pl | 4 ++-- > tools/inventory.pl | 4 ++-- > 6 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 2583f90..829d950 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1852,7 +1852,7 @@ sub searchResults { > my $shelflocations =GetKohaAuthorisedValues('items.location',''); > > # get notforloan authorised value list (see $shelflocations FIXME) >- my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' }); >+ my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } }); > my $notforloan_authorised_value = $av->count ? $av->next->authorised_value : undef; > > #Get itemtype hash >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index b022c56..46387a9 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -195,16 +195,16 @@ my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw); > my (@itemloop, @otheritemloop, %itemfields); > my $norequests = 1; > >-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' }); >+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } }); > if ( $mss->count ) { > $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) ); > } >-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' }); >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } }); > if ( $mss->count ) { > $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); > } > >-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials' }); >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => { not => undef } }); > my %materials_map; > if ($mss->count) { > my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value); >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 001cf28..a2f0e41 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -88,10 +88,10 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ > flagsrequired => { catalogue => 1 }, > }); > >-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan' }); >+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } }); > my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; > >-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location' }); >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } }); > my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; > > if (scalar keys %params > 0) { >@@ -264,7 +264,7 @@ if ($format eq 'html') { > }; > } > >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode' }); >+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } }); > my $ccode_avcode = $mss->count ? $mss->next->authorised_value : 'CCODE'; > my $ccodes = GetAuthorisedValues($ccode_avcode); > my @ccodes; >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index b18d857..1a1adec 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -194,17 +194,17 @@ foreach my $item (@items){ > > } > >-my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost' }); >+my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } }); > if ( $mss->count ) { >- $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorisedvalue ) ); >+ $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) ); > } >-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged' }); >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } }); > if ( $mss->count ) { >- $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorisedvalue ) ); >+ $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); > } >-$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn' }); >+$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } }); > if ( $mss->count ) { >- $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorisedvalue) ); >+ $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) ); > } > > $template->param(count => $data->{'count'}, >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 787d501..1501433 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -341,8 +341,8 @@ if (@$barcodes) { > # Get the item title for more information > my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); > >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan' }); >- $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorisedvalue : undef; >+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => { not => undef } }); >+ $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; > > # Fix for bug 7494: optional checkout-time fallback search for a book > >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 1ad8116..ef59268 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -72,7 +72,7 @@ $frameworks->{''} = {frameworkcode => ''}; # Add the default framework > > for my $fwk (keys %$frameworks){ > my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'}; >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location' }); >+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { not => undef } }); > my $authcode = $mss->count ? $mss->next->authorised_value : undef; > if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){ > $authorisedvalue_categories.="$authcode "; >@@ -88,7 +88,7 @@ my $statuses = []; > for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){ > my $hash = {}; > $hash->{fieldname} = $statfield; >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield }); >+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield, authorised_value => { not => undef } }); > $hash->{authcode} = $mss->count ? $mss->next->authorised_value : undef; > if ($hash->{authcode}){ > my $arr = GetAuthorisedValues($hash->{authcode}); >-- >2.1.4
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 17250
:
55186
|
55494
|
55580
|
56017
|
56269
|
56291
|
56390
| 56391