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

Evergreen Git git at git.evergreen-ils.org
Mon Feb 20 14:10:13 EST 2012


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  451db56e10bd402cbb663ca18cc3d59ba6858705 (commit)
      from  c428b52fd33a231aac0959279c07a1188576bfd3 (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 451db56e10bd402cbb663ca18cc3d59ba6858705
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Feb 14 11:09:41 2012 -0500

    Correct special winter handling in predictions
    
    The current serials prediction code has an exception for handling
    cases where 'Winter 2010' is followed by 'Spring 2010' rather than
    'Spring 2011'.  This exception assumed the more common case of a
    combined subfield $y, e.g.:
    
    $yps21,22,23,24
    
    In doing so, it incorrectly handled less common cases where the $y
    is listed separately:
    
    $yps21$yps22$yps23$yps24
    
    This change (with test data) ensures we only check the first $y
    for our 'early winter' exception.
    
    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/Caption.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
index d949b4e..297d0ab 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm
@@ -540,8 +540,13 @@ sub winter_starts_year {
     if ($freq =~ /^\d$/) {
         foreach my $pubpat (@$pubpats) {
             my $chroncode = substr($pubpat, 0, 1);
-            if ($chroncode eq 's' and substr($pubpat, 1, 2) == 24) {
-                return 1;        
+            if ($chroncode eq 's') {
+                # check first instance only
+                if (substr($pubpat, 1, 2) == 24) {
+                    return 1;
+                } else {
+                    return 0;
+                }
             }
         }
     }
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhddata.txt b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhddata.txt
index 883bf3c..162c621 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhddata.txt
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/test/mfhddata.txt
@@ -199,3 +199,9 @@
 853 20 $834$av.$bno.$u12$vr$i(year)$j(month)$wm$ycm12/01$yce22/3
 863 41 $834.1$a24$b1$i2011$j11$x|a24|b2/3|i2011/2012|j12/01$zNov. to Combined Dec./Jan.
 863 41 $834.2$a24$b2/3$i2011/2012$j12/1$x|a24|b4|i2012|j02$zCombined Dec./Jan. to Feb.
+
+# Winter does NOT start the calendar year, separate subfield 'y'
+245 00 $aWinter does NOT start the calendar year, separate subfield 'y'
+853 20 $835$av.$bno.$u4$vr$i(year)$j(season)$w4$yps21$yps22$yps23$yps24
+863 41 $835.1$a1$b4$i2010$j23$x|a2|b1|i2010|j24$zAutumn 2010 to Winter 2010 (separate 'y')
+863 41 $835.2$a2$b1$i2010$j24$x|a2|b2|i2011|j21$zWinter 2010 to Spring 2011 (separate 'y')

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm |    9 +++++++--
 .../lib/OpenILS/Utils/MFHD/test/mfhddata.txt       |    6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list