Bug 20248: Improve Elasticsearch mappings UI and rebuild_elastic_search.pl.
[koha.git] / misc / batchRebuildBiblioTables.pl
index ae4f54e..5db801b 100755 (executable)
@@ -53,7 +53,7 @@ $starttime = gettimeofday;
 
 #1st of all, find item MARC tag.
 my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.itemnumber",'');
-# $dbh->do("lock tables biblio write, biblioitems write, items write, marc_biblio write, marc_subfield_table write, marc_blob_subfield write, marc_word write, marc_subfield_structure write, stopwords write");
+# $dbh->do("lock tables biblio write, biblioitems write, items write, marc_biblio write, marc_subfield_table write, marc_blob_subfield write, marc_word write, marc_subfield_structure write");
 my $sth = $dbh->prepare("SELECT biblionumber FROM biblio");
 $sth->execute;
 # my ($biblionumbermax) =  $sth->fetchrow;
@@ -61,7 +61,7 @@ $sth->execute;
 my @errors;
 while (my ($biblionumber)= $sth->fetchrow) {
     #now, parse the record, extract the item fields, and store them in somewhere else.
-    my $record = GetMarcBiblio($biblionumber);
+    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
     if (not defined $record) {
        push @errors, $biblionumber;
        next;
@@ -96,7 +96,7 @@ if (scalar(@errors) > 0) {
 sub localNEWmodbiblio {
     my ($dbh,$record,$biblionumber,$frameworkcode) =@_;
     $frameworkcode="" unless $frameworkcode;
-    my $oldbiblio = TransformMarcToKoha($dbh,$record,$frameworkcode);
+    my $oldbiblio = TransformMarcToKoha($record,$frameworkcode);
     C4::Biblio::_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode );
     C4::Biblio::_koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio );
     return 1;