[Koha-patches] [PATCH] Bug 3630 Impossible to perform Scan Indexes search

Frédéric Demians f.demians at tamil.fr
Wed Aug 25 09:51:21 CEST 2010


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.
---
 C4/Search.pm |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/C4/Search.pm b/C4/Search.pm
index 8434886..14dcc3f 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -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;
-- 
1.7.1



More information about the Koha-patches mailing list