From f68d01b964419386dcac43aaa34fd2cf0ae09645 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 20 Feb 2018 11:19:37 +0000 Subject: [PATCH] Bug 20067: Fix other checks for linked authorised value categories The same pattern was used in other files, this patch fixes it. --- C4/Search.pm | 2 +- catalogue/detail.pl | 4 ++-- catalogue/itemsearch.pl | 6 +++--- catalogue/moredetail.pl | 6 +++--- circ/circulation.pl | 2 +- tools/inventory.pl | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index c11a61e..12934ac 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1865,7 +1865,7 @@ sub searchResults { { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) }; # get notforloan authorised value list (see $shelflocations FIXME) - my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } }); + my $av = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { '!=' => 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 e70e58e..d17dca7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -203,11 +203,11 @@ my $copynumbers = my (@itemloop, @otheritemloop, %itemfields); my $norequests = 1; -my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } }); +my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { '!=' => undef, '!=' => '' } }); if ( $mss->count ) { $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) ); } -$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } }); +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { '!=' => undef, '!=' => '' } }); if ( $mss->count ) { $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); } diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index 369142e..2e8ffdf 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -97,10 +97,10 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ flagsrequired => { catalogue => 1 }, }); -my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { not => undef } }); +my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.notforloan', authorised_value => { '!=' => undef, '!=' => '' } }); my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; -$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { not => undef } }); +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => { '!=' => undef, '!=' => '' } }); my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; if (scalar keys %params > 0) { @@ -284,7 +284,7 @@ foreach my $itemtype ( Koha::ItemTypes->search ) { }; } -$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { not => undef } }); +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.ccode', authorised_value => { '!=' => 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 c82e653..c317d3c 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -190,15 +190,15 @@ foreach my $item (@items){ } } -my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } }); +my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { '!=' => undef, '!=' => '' } }); if ( $mss->count ) { $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) ); } -$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } }); +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { '!=' => undef, '!=' => '' } }); if ( $mss->count ) { $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); } -$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } }); +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { '!=' => undef, '!=' => '' } }); if ( $mss->count ) { $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) ); } diff --git a/circ/circulation.pl b/circ/circulation.pl index 7414378..ee90696 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -350,7 +350,7 @@ if (@$barcodes) { if ( $item ) { $biblio = $item->biblio; - my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } }); + my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { '!=' => undef, '!=' => '' } }); $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; } diff --git a/tools/inventory.pl b/tools/inventory.pl index c671488..404b436 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -71,7 +71,7 @@ unshift @$frameworks, { frameworkcode => '' }; for my $fwk ( @$frameworks ){ my $fwkcode = $fwk->{frameworkcode}; - my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { not => undef } }); + my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fwkcode, kohafield => 'items.location', authorised_value => { '!=' => 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 @notforloans; 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, authorised_value => { not => undef } }); + my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => $statfield, authorised_value => { '!=' => undef, '!=' => '' } }); $hash->{authcode} = $mss->count ? $mss->next->authorised_value : undef; if ($hash->{authcode}){ my $arr = GetAuthorisedValues($hash->{authcode}); -- 2.1.4