[open-ils-commits] [GIT] Evergreen ILS branch master updated. f44becacb7548894873b4573b8a5aad48a320dae

Evergreen Git git at git.evergreen-ils.org
Wed Sep 14 13:01:33 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, master has been updated
       via  f44becacb7548894873b4573b8a5aad48a320dae (commit)
      from  8c5c65d2c6532f4e5d059d6ae59507707b428010 (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 f44becacb7548894873b4573b8a5aad48a320dae
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 d21a8cc..d31bc2a 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