Bug 10403: (follow-up) fix test to use vendor created earlier during test
[koha.git] / misc / batchupdateISBNs.pl
index a613b95..8cc8c6a 100755 (executable)
@@ -24,6 +24,7 @@
 =cut
 
 use strict;
+#use warnings; FIXME - Bug 2505
 BEGIN {
     # find Koha's Perl modules
     # test carefully before changing this
@@ -63,7 +64,7 @@ my $cpt_isbn = 0;
 if(not $no_isbn){
 
     my $query_isbn = "
-        SELECT biblioitemnumber,isbn FROM biblioitems WHERE isbn IS NOT NULL
+        SELECT biblioitemnumber,isbn FROM biblioitems WHERE isbn IS NOT NULL ORDER BY biblioitemnumber
     ";
 
     my $update_isbn = "
@@ -94,7 +95,7 @@ if(not $no_isbn){
 if(not $no_marcxml){
     
     my $query_marcxml = "
-        SELECT biblioitemnumber,marcxml FROM biblioitems WHERE isbn IS NOT NULL
+        SELECT biblioitemnumber,marcxml FROM biblioitems WHERE isbn IS NOT NULL ORDER BY biblioitemnumber
     ";
     
     
@@ -127,7 +128,7 @@ if(not $no_marcxml){
                 }
            }
             if($flag){
-                $marcxml = $record->as_xml;
+                $marcxml = $record->as_xml_record('UNIMARC');
                 # Update
                 my $sth = $dbh->prepare($update_marcxml);
                 $sth->execute($marcxml,$biblioitemnumber);