From 2b27da1e06de5666b870ea6a7447f7762f301676 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 27 Oct 2004 08:11:44 +0000 Subject: [PATCH] bugfix : using concat instead of + to merge field & subfield. Otherwise, when the subfield is a number, it's a numeric addition that is done !!! --- C4/SearchMarc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index 303e7db61d..e93267656f 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -400,7 +400,7 @@ sub create_request { $sql_tables .= "marc_subfield_table as m$nb_table,"; $sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]"); if (@$tags[$i]) { - $sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])"; + $sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])"; } $sql_where1.=")"; } elsif (@$operator[$i] eq "contains") { @@ -414,7 +414,7 @@ sub create_request { $sql_tables .= "marc_subfield_table as m$nb_table,"; $sql_where1 .= "(m1.subfieldvalue @$operator[$i] ".$dbh->quote("@$value[$i]"); if (@$tags[$i]) { - $sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])"; + $sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])"; } $sql_where1.=")"; } @@ -424,7 +424,7 @@ sub create_request { $sql_tables .= "marc_subfield_table as m$nb_table,"; $sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]"); if (@$tags[$i]) { - $sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])"; + $sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])"; } $sql_where1.=")"; $sql_where2 .= "m1.bibid=m$nb_table.bibid and "; @@ -451,7 +451,7 @@ sub create_request { $sql_tables .= "marc_subfield_table as m$nb_table,"; $sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue @$operator[$i] ".$dbh->quote(@$value[$i]); if (@$tags[$i]) { - $sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])"; + $sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])"; } $sql_where2 .= "m1.bibid=m$nb_table.bibid and "; $sql_where1.=")"; -- 2.39.5