[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. e9cd94c0831322cae41b16b6b0a08565fe3ea7ff
Evergreen Git
git at git.evergreen-ils.org
Wed Sep 28 15:44:37 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 e9cd94c0831322cae41b16b6b0a08565fe3ea7ff (commit)
from afe2848074bd8c3979d6ec25f40c6dd50123e243 (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 e9cd94c0831322cae41b16b6b0a08565fe3ea7ff
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