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

Evergreen Git git at git.evergreen-ils.org
Fri Oct 4 13:45:13 EDT 2013


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  a420b0ea38e329570b4df6252ce384fa241f2ea7 (commit)
      from  ebb94c3fd23fbe79f7d1b991431cdc485e2cba00 (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 a420b0ea38e329570b4df6252ce384fa241f2ea7
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Oct 3 17:54:03 2013 -0400

    Relax MFHD subfield 'a' requirement for caption/patterns
    
    If going by the book, every caption/pattern field would have a
    subfield 'a', since the data from subfield 'i' would be moved to
    'a' if 'a' was empty.  Since that is arcane, and our own wizards
    used to bend this rule, let's make some minor adjustments to our
    expectations:
    
    1) When calculating date progression, don't expect there to be an 'a'
    subfield which needs to be "carried" into.
    2) When determining whether a field is 'open-ended', check the first
    availabile enum/chron subfield rather than hard-coding the check to
    'a'.
    
    These changes do not affect the display formatters, so strings
    generated from 'a'-less caption/pattern combos are not exactly right,
    but they suffice.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Ben Shum <bshum at biblio.org>

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 a1c9e1b..b79afe0 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
@@ -526,7 +526,11 @@ sub next_chron {
                 }
             }
         }
-    } elsif ($carry) {
+    } elsif ($carry and exists $next->{a}) {
+        # If we have only chron fields ('i' through 'm'), don't vivicate an 'a'.
+        # It would be more standard for the chron fields to have been moved to
+        # the enum fields, but imperfect patterns exist, and that's an odd
+        # rule anyway.
         $next->{a} += $carry;
     }
 }
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm
index 37f985a..433596e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm
@@ -35,10 +35,12 @@ sub new {
     # TODO: full support for second indicators 2, 3, and 4
     $self->{_mfhdh_OPEN_ENDED}     = 0;
 
+    my $first_enum_or_chron_code = '';
     foreach my $subfield ($self->subfields) {
         my ($key, $val) = @$subfield;
 
         if ($key =~ /[a-m]/) {
+            $first_enum_or_chron_code = $key unless $first_enum_or_chron_code;
             if (exists($self->{_mfhdh_FIELDS}->{$key})) {
                 carp("Duplicate, non-repeatable subfield '$key' found, ignoring");
                 next;
@@ -82,7 +84,7 @@ sub new {
     }
 
     if (   $self->{_mfhdh_COMPRESSED}
-        && $self->{_mfhdh_FIELDS}{'a'}{HOLDINGS}[1] eq '') {
+        && $self->{_mfhdh_FIELDS}{$first_enum_or_chron_code}{HOLDINGS}[1] eq '') {
         $self->{_mfhdh_OPEN_ENDED} = 1;
     }
     bless($self, $class);

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm |    6 +++++-
 .../src/perlmods/lib/OpenILS/Utils/MFHD/Holding.pm |    4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list