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

Evergreen Git git at git.evergreen-ils.org
Wed Sep 28 15:44:22 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  6970e27424e43fa35c2e876025bfe89091b553f2 (commit)
      from  10ed91a20a1f76d452688b0033b8a33b7d988e32 (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 6970e27424e43fa35c2e876025bfe89091b553f2
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Sep 27 12:22:38 2011 -0400

    MFHD compression fails with pattern-less captions
    
    The current code assumes that if you try to compress a range of
    MFHD holdings, you actually have the necessary pattern information.
    This commit introduces a very basic check to avoid the most common
    failure case.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm
index 6964c56..309f9fe 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm
@@ -358,6 +358,12 @@ sub get_compressed_holdings {
     my $opts = shift;
     my $skip_sort = $opts->{'skip_sort'};
 
+    # basic check for necessary pattern information
+    if (!scalar keys %{$caption->pattern}) {
+        carp "Cannot compress without pattern data, returning original holdings";
+        return $self->holdings_by_caption($caption);
+    }
+
     # make sure none are compressed (except for open-ended)
     my @decomp_holdings;
     if ($skip_sort) {
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
index 9445834..d949b4e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
@@ -128,6 +128,12 @@ sub decode_pattern {
     # XXX WRITE ME (?)
 }
 
+sub pattern {
+    my $self = shift;
+
+    return $self->{_mfhdc_PATTERN};
+}
+
 sub compressible {
     my $self = shift;
 

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

Summary of changes:
 Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm    |    6 ++++++
 .../src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list