backport r13981 and r17493
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Oct 2010 23:47:25 +0000 (23:47 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Oct 2010 23:47:25 +0000 (23:47 +0000)
* (Bill Erickson) don't call ingest from within bib create/overlay code
  before the changes would have been comitted
* (Dan Scott) make selecting the bib source during Vandelay imports
  work

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_0@18394 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm
Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm
Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm

index dfeef5f..296d3e8 100644 (file)
@@ -568,7 +568,7 @@ sub create_lineitem_assets_impl {
     unless($li->eg_bib_id) {
 
        my $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
-            $e, $li->marc, undef, undef, undef, 1); #$rec->bib_source
+            $e, $li->marc); #$rec->bib_source
 
         if($U->event_code($record)) {
             $e->rollback;
index 8a1e86f..155b0dc 100644 (file)
@@ -775,11 +775,9 @@ sub create_bib {
     my $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
         $mgr->editor, 
         $li->marc, 
-        undef, 
+        undef, # bib source
         undef, 
         1, # override tcn collisions
-        1, # no-ingest
-        undef # $rec->bib_source
     ); 
 
     if($U->event_code($record)) {
index b4c2c57..f18e631 100644 (file)
@@ -160,12 +160,11 @@ sub biblio_record_replace_marc  {
        return $e->die_event unless $e->checkauth;
        return $e->die_event unless $e->allowed('CREATE_MARC', $e->requestor->ws_ou);
 
-    my $no_ingest = 1;
     my $fix_tcn = $self->api_name =~ /replace/o;
     my $override = $self->api_name =~ /override/o;
 
     my $res = OpenILS::Application::Cat::BibCommon->biblio_record_replace_marc(
-        $e, $recid, $newxml, $source, $fix_tcn, $override, $no_ingest);
+        $e, $recid, $newxml, $source, $fix_tcn, $override);
 
     $e->commit unless $U->event_code($res);
 
@@ -257,7 +256,7 @@ sub biblio_record_xml_import {
 
        my $override = $self->api_name =~ /override/;
     my $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
-        $e, $xml, $source, $auto_tcn, $override, 1);
+        $e, $xml, $source, $auto_tcn, $override);
 
     return $record if $U->event_code($record);
 
index 2040b8d..1e311c2 100644 (file)
@@ -36,7 +36,7 @@ sub fetch_bib_sources {
 
 
 sub biblio_record_replace_marc  {
-       my($class, $e, $recid, $newxml, $source, $fixtcn, $override, $noingest) = @_;
+       my($class, $e, $recid, $newxml, $source, $fixtcn, $override) = @_;
 
        my $rec = $e->retrieve_biblio_record_entry($recid)
                or return $e->die_event;
@@ -70,17 +70,11 @@ sub biblio_record_replace_marc  {
        $rec->marc( $U->entityize( $marcdoc->documentElement->toString ) );
        $e->update_biblio_record_entry($rec) or return $e->die_event;
 
-    unless ($noingest) {
-        # we don't care about the result, just fire off the request
-        my $ses = OpenSRF::AppSession->create('open-ils.ingest');
-        $ses->request('open-ils.ingest.full.biblio.record', $recid);
-    }
-
        return $rec;
 }
 
 sub biblio_record_xml_import {
-       my($class, $e, $xml, $source, $auto_tcn, $override, $noingest) = @_;
+       my($class, $e, $xml, $source, $auto_tcn, $override) = @_;
 
        my( $evt, $tcn, $tcn_source, $marcdoc );
 
@@ -109,12 +103,6 @@ sub biblio_record_xml_import {
     $record = $e->create_biblio_record_entry($record) or return $e->die_event;
        $logger->info("marc create/import created new record ".$record->id);
 
-    unless ($noingest) {
-        # we don't care about the result, just fire off the request
-        my $ses = OpenSRF::AppSession->create('open-ils.ingest');
-        $ses->request('open-ils.ingest.full.biblio.record', $record->id);
-    }
-
        return $record;
 }
 
index 9de5e6a..570eeab 100644 (file)
@@ -541,6 +541,13 @@ sub import_record_list_impl {
     my %queues;
     my @ingest_queue;
 
+    my %bib_sources; 
+    my $editor = new_editor(); 
+    my $sources = $editor->search_config_bib_source({id => {'!=' => undef}}); 
+    foreach my $src (@$sources) { 
+        $bib_sources{$src->id} = $src->source; 
+    } 
+
     my $ingest_ses = OpenSRF::AppSession->connect('open-ils.ingest');
 
     for my $rec_id (@$rec_ids) {
@@ -570,11 +577,11 @@ sub import_record_list_impl {
             if(defined $overlay_target) {
                 $logger->info("vl: overlaying record $overlay_target");
                 $record = OpenILS::Application::Cat::BibCommon->biblio_record_replace_marc(
-                    $e, $overlay_target, $rec->marc, undef, undef, undef, 1); #$rec->bib_source
+                    $e, $overlay_target, $rec->marc, $bib_sources{$rec->bib_source});
             } else {
                 $logger->info("vl: importing new record");
                 $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
-                    $e, $rec->marc, undef, undef, undef, 1); #$rec->bib_source
+                    $e, $rec->marc, $bib_sources{$rec->bib_source});
             }
 
             if($U->event_code($record)) {