Bug 20811: (QA follow-up) Make the isbn check work
[koha.git] / misc / migration_tools / bulkmarcimport.pl
index 46c5017..765f03a 100755 (executable)
@@ -296,11 +296,11 @@ RECORD: while (  ) {
     &$localcust($record) if $localcust;
     my $isbn;
     # remove trailing - in isbn (only for biblios, of course)
-    if ($biblios && $cleanisbn) {
+    if( $biblios ) {
         my $tag = $marcFlavour eq 'UNIMARC' ? '010' : '020';
         my $field = $record->field($tag);
-        my $isbn = $field && $field->subfield('a');
-        if ( $isbn ) {
+        $isbn = $field && $field->subfield('a');
+        if ( $isbn && $cleanisbn ) {
             $isbn =~ s/-//g;
             $field->update('a' => $isbn);
         }