Bugzilla – Attachment 73182 Details for
Bug 20067
Wrong display of authorised value for items.materials on staff detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20067: Fix other checks for linked authorised value categories
Bug-20067-Fix-other-checks-for-linked-authorised-v.patch (text/plain), 7.76 KB, created by
Nick Clemens (kidclamp)
on 2018-03-23 14:05:47 UTC
(
hide
)
Description:
Bug 20067: Fix other checks for linked authorised value categories
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-03-23 14:05:47 UTC
Size:
7.76 KB
patch
obsolete
>From 4c04caaa67d3e7c7788a76963728c38dd5b3ae41 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Fri, 23 Feb 2018 14:29:48 +0100 >Subject: [PATCH] Bug 20067: Fix other checks for linked authorised value > categories > >The same pattern was used in other files, this patch fixes it. > >Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > 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..d92abe9 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 => [ -and => {'!=' => 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 6455604..86a0698 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => undef }, {'!=' => ''}] }); > if ( $mss->count ) { > $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); > } >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 369142e..c035a64 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => 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..845d10e 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => undef }, {'!=' => ''}] }); > if ( $mss->count ) { > $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) ); > } >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 93ed09c..1aa6d55 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 => [ -and => {'!=' => undef }, {'!=' => ''}] }); > $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; > } > >diff --git a/tools/inventory.pl b/tools/inventory.pl >index c671488..3da000a 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 => [ -and => {'!=' => 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 => [ -and => {'!=' => 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 20067
:
70807
|
70808
|
70809
|
72100
|
72101
|
72120
|
72121
|
72991
|
72992
|
73181
| 73182