[Koha-devel] Bug in "undo import" in Tools - MARC Import (managing batches)

Zeno Tajoli tajoli at cilea.it
Wed Jul 16 11:36:58 CEST 2008


Hi to all,

I have found a bug in the "undo import" function avible in Tools - 
MARC Import (managing batches).
I'm working in a NoZebra setup and I think it is relevant.
I don't find this bug in http://bugs.koha.org/cgi-bin/bugzilla/index.cgi
OS: Linux Debian etch
Version of Koha: last git version
MySQL: 5.0
Apache: 2.0


If Import a record into the official catalogue and after I delete the 
imported record with the function
"undo import", the record is deleted from the db but in the indexes 
the pointers to the records are still present.
So, if I do a search with a keyword of the deleted record I see this error:

<div class="error">
<h4>Error:</h4>
Can't call method "as_usmarc" on an undefined value at 
/var/donw/kohaclone/kohaclone2/C4/Search.pm line 2078.
</div>

If I lanch the script ../misc/migration_tools/rebuild_nozebra.pl, the 
problem is over.
Here an excerpt of the debug:

C4::Search::NZorder(/var/donw/kohaclone/kohaclone2/C4/Search.pm:2057):
2057:               foreach my $key ( sort ( keys %result ) ) {
   DB<7> 
n 
C4::Search::NZorder(/var/donw/kohaclone/kohaclone2/C4/Search.pm:2058):
2058:                   $result_hash->{'RECORDS'}[ $numbers++ ] = 
$result{$key};
DB<7> x 
%result 

0  'bianciardi-218'
1  18
2  'bianciardi-115'
3  15
4  'bianciardi-118'
5  18
6  'bianciardi-217'
7  17
8  'bianciardi-117'
9  17
10  'bianciardi-215'
11  15
[...]
   DB<8> 
n 

C4::Search::NZorder(/var/donw/kohaclone/kohaclone2/C4/Search.pm:2072):
2072:           for (
2073:               my $counter = $offset ;
2074:               $counter <= $offset + $results_per_page ;
2075:               $counter++
2076:             )
2077:           {
   DB<8> 
n 

C4::Search::NZorder(/var/donw/kohaclone/kohaclone2/C4/Search.pm:2078):
2078:               $result_hash->{'RECORDS'}[$counter] =
2079:                 GetMarcBiblio( 
$result_hash->{'RECORDS'}[$counter] )->as_usmarc;
   DB<8> x 
$result_hash 

0  HASH(0x9d7a2dc)
    'RECORDS' => ARRAY(0x9d4580c)
       0  15
       1  17
       2  18
       3  15
       4  17
       5  18

   DB<9> 
n 

main::(opac-search.pl:394):     if ($@ || $error) {
   DB<9> 
n 

main::(opac-search.pl:395):         $template->param(query_error => $error.$@);
   DB<9> 
n 

main::(opac-search.pl:396):         output_html_with_http_headers 
$cgi, $cookie, $template->output;
   DB<9> 
n 

EXPR:at pos 8: non-initialized variable category
[...]
Here the output error
<div class="error">
         <h4>Error:</h4>
     Can't call method "as_usmarc" on an undefined value at 
/var/donw/kohaclone/kohaclone2/C4/Search.pm line 2078.

</div>

The records ids that are present in the live db are 17 and 18, 15 was 
deleted but the pointer is still present into the indexes.

I don't know if it is blocking bug, only librarian works with batch imports.
I suggest to comment the function "undo import" and to re-insert it 
into 3.2 with a delete also on indexes, with attention on Zebra and 
NoZebra setup.

Attention on documentation, the page 
http://sites.google.com/a/liblime.com/koha-manual/Home/Table-of-Contents/Tools/Tools--Managed-Staged-MARC-Records 
explain also the "undo import" function.

Bye to all
Zeno Tajoli

Zeno Tajoli
CILEA - Segrate (MI)
tajoliAT_SPAM_no_prendiATcilea.it
(Indirizzo mascherato anti-spam; sostituisci quanto tra AT con @)

_______________________________________________
Koha-devel mailing list
Koha-devel at lists.koha.org
http://lists.koha.org/mailman/listinfo/koha-devel



More information about the Koha-devel mailing list