[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. da75e94d037be0de04469b9140770a5201c1a8b5

Evergreen Git git at git.evergreen-ils.org
Fri Nov 22 09:12:31 EST 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, rel_2_4 has been updated
       via  da75e94d037be0de04469b9140770a5201c1a8b5 (commit)
      from  77256cc92f1d97484fd4e850f3942b6656582a5f (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 da75e94d037be0de04469b9140770a5201c1a8b5
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: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

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 a873372..5e966d9 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