Bugzilla – Attachment 31324 Details for
Bug 12861
Noisy warns in C4/AuthoritiesMarc.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12861 : Noisy warn in the error logs
Bug-12861--Noisy-warn-in-the-error-logs.patch (text/plain), 5.54 KB, created by
Chris Cormack
on 2014-09-02 22:06:23 UTC
(
hide
)
Description:
Bug 12861 : Noisy warn in the error logs
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-09-02 22:06:23 UTC
Size:
5.54 KB
patch
obsolete
>From 00f2211872a38ed5c0541e6da0607084da6faf7f Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Wed, 3 Sep 2014 09:49:41 +1200 >Subject: [PATCH] Bug 12861 : Noisy warn in the error logs > >To test >Hit a url like >cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=FIRECLAY > >Notice the warns in the error log >Apply patch >Reload the url >Still works but no warns > >(cherry picked from commit c98d805e490a82b2ea9f3d4e0f7278640942ba6d) >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/AuthoritiesMarc.pm | 105 ++++++++++++++++++++++++++------------------------ > 1 file changed, 54 insertions(+), 51 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index e983159..8881da3 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -143,57 +143,60 @@ sub SearchAuthorities { > for(my $i = 0 ; $i <= $#{$value} ; $i++) > { > if (@$value[$i]){ >- if ( @$tags[$i] eq "mainmainentry" ) { >- $attr = " \@attr 1=Heading-Main "; >- } >- elsif ( @$tags[$i] eq "mainentry" ) { >- $attr = " \@attr 1=Heading "; >- } >- elsif ( @$tags[$i] eq "match" ) { >- $attr = " \@attr 1=Match "; >- } >- elsif ( @$tags[$i] eq "match-heading" ) { >- $attr = " \@attr 1=Match-heading "; >- } >- elsif ( @$tags[$i] eq "see-from" ) { >- $attr = " \@attr 1=Match-heading-see-from "; >- } >- elsif ( @$tags[$i] eq "thesaurus" ) { >- $attr = " \@attr 1=Subject-heading-thesaurus "; >- } >- else { # Assume any if no index was specified >- $attr = " \@attr 1=Any "; >- } >- if ( @$operator[$i] eq 'is' ) { >- $attr .= " \@attr 4=1 \@attr 5=100 " >- ; ##Phrase, No truncation,all of subfield field must match >- } >- elsif ( @$operator[$i] eq "=" ) { >- $attr .= " \@attr 4=107 "; #Number Exact match >- } >- elsif ( @$operator[$i] eq "start" ) { >- $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 " >- ; #Firstinfield Phrase, Right truncated >- } >- elsif ( @$operator[$i] eq "exact" ) { >- $attr .= " \@attr 4=1 \@attr 5=100 \@attr 6=3 " >- ; ##Phrase, No truncation,all of subfield field must match >- } >- else { >- $attr .= " \@attr 5=1 \@attr 4=6 " >- ; ## Word list, right truncated, anywhere >- if ($sortby eq 'Relevance') { >- $attr .= "\@attr 2=102 "; >- } >- } >- @$value[$i] =~ s/"/\\"/g; # Escape the double-quotes in the search value >- $attr =$attr."\"".@$value[$i]."\""; >- $q2 .=$attr; >- $dosearch=1; >- ++$attr_cnt; >- if ($QParser) { >- $qpquery .= " $tags->[$i]:\"$value->[$i]\""; >- } >+ if ( @$tags[$i] ) { >+ if ( @$tags[$i] eq "mainmainentry" ) { >+ $attr = " \@attr 1=Heading-Main "; >+ } >+ elsif ( @$tags[$i] eq "mainentry" ) { >+ $attr = " \@attr 1=Heading "; >+ } >+ elsif ( @$tags[$i] eq "match" ) { >+ $attr = " \@attr 1=Match "; >+ } >+ elsif ( @$tags[$i] eq "match-heading" ) { >+ $attr = " \@attr 1=Match-heading "; >+ } >+ elsif ( @$tags[$i] eq "see-from" ) { >+ $attr = " \@attr 1=Match-heading-see-from "; >+ } >+ elsif ( @$tags[$i] eq "thesaurus" ) { >+ $attr = " \@attr 1=Subject-heading-thesaurus "; >+ } >+ else { # Assume any if no index was specified >+ $attr = " \@attr 1=Any "; >+ } >+ if ( @$operator[$i] eq 'is' ) { >+ $attr .= " \@attr 4=1 \@attr 5=100 " >+ ; ##Phrase, No truncation,all of subfield field must match >+ } >+ elsif ( @$operator[$i] eq "=" ) { >+ $attr .= " \@attr 4=107 "; #Number Exact match >+ } >+ elsif ( @$operator[$i] eq "start" ) { >+ $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 " >+ ; #Firstinfield Phrase, Right truncated >+ } >+ elsif ( @$operator[$i] eq "exact" ) { >+ $attr .= " \@attr 4=1 \@attr 5=100 \@attr 6=3 " >+ ; ##Phrase, No truncation,all of subfield field must match >+ } >+ else { >+ $attr .= " \@attr 5=1 \@attr 4=6 " >+ ; ## Word list, right truncated, anywhere >+ if ( $sortby eq 'Relevance' ) { >+ $attr .= "\@attr 2=102 "; >+ } >+ } >+ @$value[$i] =~ >+ s/"/\\"/g; # Escape the double-quotes in the search value >+ $attr = $attr . "\"" . @$value[$i] . "\""; >+ $q2 .= $attr; >+ $dosearch = 1; >+ ++$attr_cnt; >+ if ($QParser) { >+ $qpquery .= " $tags->[$i]:\"$value->[$i]\""; >+ } >+ } #if (@$tags[$i) > }#if value > } > ##Add how many queries generated >-- >2.0.1
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 12861
:
31324
|
32782
|
35304
|
35308
|
35360
|
35364
|
35365