Bug 3630 Impossible to perform Scan Indexes search
authorFrédéric Demians <f.demians@tamil.fr>
Wed, 25 Aug 2010 07:51:21 +0000 (09:51 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 6 Oct 2010 12:18:17 +0000 (08:18 -0400)
This is a quick fix. The way scan indexes performs should be improved in
3.4. There are several issues:

  - No paging
  - The interface is the same as for biblio records search result and so
    is unusable: for example you have a button to place a hold or you
    can sort by Popularity which is irrelevant for index terms.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

C4/Search.pm

index 2cc2dfb..d36459a 100644 (file)
@@ -1426,12 +1426,11 @@ sub searchResults {
     # loop through all of the records we've retrieved
     for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) {
         my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] );
-        if ($bibliotag<10){
-            $fw = GetFrameworkCode($marcrecord->field($bibliotag)->data);
-        }else{
-            $fw = GetFrameworkCode($marcrecord->subfield($bibliotag,$bibliosubf));
-        }
-
+        $fw = $scan
+             ? undef
+             : $bibliotag < 10
+               ? GetFrameworkCode($marcrecord->field($bibliotag)->data)
+               : GetFrameworkCode($marcrecord->subfield($bibliotag,$bibliosubf));
         my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw );
         $oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord, $fw);
         $oldbiblio->{result_number} = $i + 1;