From 29abf93b294c4fbbdf2a5c518a78bcdb707c1cbc Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 31 Aug 2006 21:14:45 +0000 Subject: [PATCH] more updates ... more diffs git-svn-id: svn://svn.open-ils.org/ILS/trunk@5818 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/src/extras/import/parse_patron_xml.pl | 12 +++++++++++- Open-ILS/src/extras/import/pg_loader.pl | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Evergreen/src/extras/import/parse_patron_xml.pl b/Evergreen/src/extras/import/parse_patron_xml.pl index f4ccd29576..9a245eda75 100755 --- a/Evergreen/src/extras/import/parse_patron_xml.pl +++ b/Evergreen/src/extras/import/parse_patron_xml.pl @@ -78,6 +78,7 @@ $orgs = { map { ($_->shortname => $_->id) } @$orgs }; my $starttime = time; my $count = 1; for my $patron ( $doc->documentElement->childNodes ) { + next if ($patron->nodeType == 3); my $p = new Fieldmapper::actor::user; my $card = new Fieldmapper::actor::card; my $profile_sce = new Fieldmapper::actor::stat_cat_entry_user_map; @@ -86,13 +87,19 @@ for my $patron ( $doc->documentElement->childNodes ) { my $bc = $patron->findvalue( 'user_id' ); - next unless $bc; + unless (defined($bc)) { + my $xml = $patron->toString; + warn "!!! no barcode found in UMS data, user number $count, xml => $xml \n"; + $count++; + next; + } my $uid; if (keys %u_map) { $uid = $u_map{$bc}; unless ($uid) { $count++; + warn "!!! no uid mapping found for barcode $bc\n"; next; } } else { @@ -101,6 +108,7 @@ for my $patron ( $doc->documentElement->childNodes ) { unless ($uid > 1) { $count++; + warn "!!! user id lower than 2\n"; next; } @@ -117,6 +125,7 @@ for my $patron ( $doc->documentElement->childNodes ) { $p->profile( $$profiles{$new_profile} ); if (!$p->profile) { $count++; + warn "!!! no new profile found for $old_profile\n"; next; } @@ -159,6 +168,7 @@ for my $patron ( $doc->documentElement->childNodes ) { my $hlib = $$orgs{$patron->findvalue( 'user_library' )}; unless ($hlib) { $count++; + warn "!!! no home library found in patron record\n"; next; } $p->home_ou( $hlib ); diff --git a/Open-ILS/src/extras/import/pg_loader.pl b/Open-ILS/src/extras/import/pg_loader.pl index 7abe5557c3..ad5ee8885f 100755 --- a/Open-ILS/src/extras/import/pg_loader.pl +++ b/Open-ILS/src/extras/import/pg_loader.pl @@ -43,7 +43,7 @@ while ( my $rec = <> ) { my $e = shift; warn "\n\n !!! Error : $e \n\n at or around line $count\n"; }; - die unless ($row); + next unless ($row); my $class = $row->class_name; my $hint = $row->json_hint; -- 2.43.2