[Koha-patches] [PATCH][SIGNED-OFF] Bug 2809 : Rebased and Reformatted for master, please test thoroughly

Stéphane Delaune stephane.delaune at biblibre.com
Fri Jul 22 10:31:45 CEST 2011


From: Chris Cormack <chrisc at catalyst.net.nz>


Signed-off-by: Stéphane Delaune <stephane.delaune at biblibre.com>
---
 C4/Search.pm |   42 +++++++++++++++++++++++-------------------
 1 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/C4/Search.pm b/C4/Search.pm
index c3cff65..9a66c9c 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -1147,15 +1147,15 @@ sub buildQuery {
                 # Date of Publication
                 if ( $index eq 'yr' ) {
                     $index .= ",st-numeric";
-                    $indexes_set++;
-					$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0;
+#                    $indexes_set++;
+		    $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0;
                 }
 
                 # Date of Acquisition
                 elsif ( $index eq 'acqdate' ) {
                     $index .= ",st-date-normalized";
-                    $indexes_set++;
-					$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0;
+#                    $indexes_set++;
+		    $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0;
                 }
                 # ISBN,ISSN,Standard Number, don't need special treatment
                 elsif ( $index eq 'nb' || $index eq 'ns' ) {
@@ -1336,21 +1336,25 @@ sub buildQuery {
 
         # Regular old limits
         else {
-            $limit .= " and " if $limit || $query;
-            $limit      .= "$this_limit";
-            $limit_cgi  .= "&limit=$this_limit";
-            if ($this_limit =~ /^branch:(.+)/) {
-                my $branchcode = $1;
-                my $branchname = GetBranchName($branchcode);
-                if (defined $branchname) {
-                    $limit_desc .= " branch:$branchname";
-                } else {
-                    $limit_desc .= " $this_limit";
-                }
-            } else {
-                $limit_desc .= " $this_limit";
-            }
-        }
+	    if ($this_limit){
+		$limit .= " and " if $limit || $query;
+		$limit      .= "$this_limit";
+		$limit_cgi  .= "&limit=$this_limit";
+		if ($this_limit =~ /^branch:(.+)/) {
+		    my $branchcode = $1;
+		    my $branchname = GetBranchName($branchcode);
+		    if (defined $branchname) {
+			$limit_desc .= " branch:$branchname";
+		    } 
+		    else {
+			$limit_desc .= " $this_limit";
+		    }
+		} 
+		else {
+		    $limit_desc .= " $this_limit";
+		}
+	    }
+	}
     }
     if ($group_OR_limits) {
         $limit .= " and " if ( $query || $limit );
-- 
1.7.0.4



More information about the Koha-patches mailing list