[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. af806351525895e3a223e954b3ca124e8a74e6bd

Evergreen Git git at git.evergreen-ils.org
Wed Sep 14 13:01:56 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  af806351525895e3a223e954b3ca124e8a74e6bd (commit)
      from  711306ddfa532bf352a824a9795f4b8ee6f82c03 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit af806351525895e3a223e954b3ca124e8a74e6bd
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Sep 14 12:27:45 2011 -0400

    lp834961: fix authoritative versions of callnumber retrieval calls
    
    Makes open-ils.search.callnumber[.fleshed].retrieve.authoritative
    actually be authoritative.  Fixes bug where adding a volume
    could result in a false ASSET_CALL_NUMBER_NOT_FOUND error if using
    database replication and Slony-II.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
index 8b29701..a866508 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
@@ -713,41 +713,21 @@ sub fetch_copy_location_by_name {
 }
 
 sub fetch_callnumber {
-	my( $self, $id, $flesh ) = @_;
-	my $evt = undef;
+	my( $self, $id, $flesh, $e ) = @_;
+
+	$e ||= OpenILS::Utils::CStoreEditor->new;
 
-	my $e = OpenILS::Event->new( 'ASSET_CALL_NUMBER_NOT_FOUND', id => $id );
-	return( undef, $e ) unless $id;
+	my $evt = OpenILS::Event->new( 'ASSET_CALL_NUMBER_NOT_FOUND', id => $id );
+	return( undef, $evt ) unless $id;
 
 	$logger->debug("Fetching callnumber $id");
 
-	my $cn = $self->simplereq(
-		'open-ils.cstore',
-		'open-ils.cstore.direct.asset.call_number.retrieve', $id );
-	$evt = $e  unless $cn;
-
-    if ($flesh && $cn) {
-        $cn->prefix(
-            $self->simplereq(
-                'open-ils.cstore',
-                'open-ils.cstore.direct.asset.call_number_prefix.retrieve', $cn->prefix
-            )
-        );
-        $cn->suffix(
-            $self->simplereq(
-                'open-ils.cstore',
-                'open-ils.cstore.direct.asset.call_number_suffix.retrieve', $cn->suffix
-            )
-        );
-        $cn->label_class(
-            $self->simplereq(
-                'open-ils.cstore',
-                'open-ils.cstore.direct.asset.call_number_class.retrieve', $cn->label_class
-            )
-        );
-    }
+    my $cn = $e->retrieve_asset_call_number([
+        $id,
+        { flesh => $flesh, flesh_fields => { acn => [ 'prefix', 'suffix', 'label_class' ] } },
+    ]);
 
-	return ( $cn, $evt );
+	return ( $cn, $e->event );
 }
 
 my %ORG_CACHE; # - these rarely change, so cache them..
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
index 79dec4d..2bc7062 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
@@ -2373,7 +2373,9 @@ __PACKAGE__->register_method(
 
 sub fetch_cn {
 	my( $self, $client, $id ) = @_;
-	my( $cn, $evt ) = $apputils->fetch_callnumber( $id );
+
+	my $e = new_editor();
+	my( $cn, $evt ) = $apputils->fetch_callnumber( $id, 0, $e );
 	return $evt if $evt;
 	return $cn;
 }
@@ -2387,7 +2389,9 @@ __PACKAGE__->register_method(
 
 sub fetch_fleshed_cn {
 	my( $self, $client, $id ) = @_;
-	my( $cn, $evt ) = $apputils->fetch_callnumber( $id, 1 );
+
+	my $e = new_editor();
+	my( $cn, $evt ) = $apputils->fetch_callnumber( $id, 1, $e );
 	return $evt if $evt;
 	return $cn;
 }

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/AppUtils.pm   |   42 +++++--------------
 .../lib/OpenILS/Application/Search/Biblio.pm       |    8 +++-
 2 files changed, 17 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list