Bug 8656 Calendar needs to load both exception and nonexception dates
[koha_fer] / C4 / Search.pm
index 4f61661..d9b53ac 100644 (file)
@@ -477,7 +477,8 @@ sub getRecords {
                                 # avoid first line
                                 my $tag_num = substr($tag, 0, 3);
                                 my $letters = substr($tag, 3);
-                                my $field_pattern = '\n' . $tag_num . ' ([^\n]+)';
+                                my $field_pattern = '\n' . $tag_num . ' ([^z][^\n]+)';
+                                $field_pattern = '\n' . $tag_num . ' ([^\n]+)' if (int($tag_num) < 10);
                                 my @field_tokens = ( $render_record =~ /$field_pattern/g ) ;
                                 foreach my $field_token (@field_tokens) {
                                     my @subf = ( $field_token =~ /\$([a-zA-Z0-9]) ([^\$]+)/g );
@@ -732,7 +733,7 @@ sub _detect_truncation {
 sub _build_stemmed_operand {
     my ($operand,$lang) = @_;
     require Lingua::Stem::Snowball ;
-    my $stemmed_operand;
+    my $stemmed_operand=q{};
 
     # If operand contains a digit, it is almost certainly an identifier, and should
     # not be stemmed.  This is particularly relevant for ISBNs and ISSNs, which
@@ -1415,7 +1416,7 @@ sub buildQuery {
 
   my @search_results = searchResults($search_context, $searchdesc, $hits, 
                                      $results_per_page, $offset, $scan, 
-                                     @marcresults, $hidelostitems);
+                                     @marcresults);
 
 Format results in a form suitable for passing to the template
 
@@ -1469,12 +1470,7 @@ sub searchResults {
     }
 
     #search item field code
-    my $sth =
-      $dbh->prepare(
-"SELECT tagfield FROM marc_subfield_structure WHERE kohafield LIKE 'items.itemnumber'"
-      );
-    $sth->execute;
-    my ($itemtag) = $sth->fetchrow;
+    my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" );
 
     ## find column names of items related to MARC
     my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items");
@@ -1792,7 +1788,7 @@ sub searchResults {
         # XSLT processing of some stuff
        use C4::Charset;
        SetUTF8Flag($marcrecord);
-       $debug && warn $marcrecord->as_formatted;
+        warn $marcrecord->as_formatted if $DEBUG;
        my $interface = $search_context eq 'opac' ? 'OPAC' : '';
        if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) {
             $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems);
@@ -1823,8 +1819,6 @@ sub searchResults {
         $oldbiblio->{intransitcount}       = $item_in_transit_count;
         $oldbiblio->{onholdcount}          = $item_onhold_count;
         $oldbiblio->{orderedcount}         = $ordered_count;
-        # deleting - in isbn to enable amazon content
-        $oldbiblio->{isbn} =~ s/-//g;
 
         if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
             my $fieldspec = C4::Context->preference("AlternateHoldingsField");