[open-ils-commits] r13808 - trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD (djfiander)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Aug 11 12:10:17 EDT 2009


Author: djfiander
Date: 2009-08-11 12:10:14 -0400 (Tue, 11 Aug 2009)
New Revision: 13808

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm
Log:
Deal with a publication that only has a single level of
enumeration (ie, only volume numbers).


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm	2009-08-11 13:47:32 UTC (rev 13807)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm	2009-08-11 16:10:14 UTC (rev 13808)
@@ -541,7 +541,15 @@
     # 1) we hit the correct number of items in $b (ie, 5th iss of quarterly)
     # 2) it's the right time of the year.
     #
-    $carry = 0;
+
+    # If there's a subfield b, then we will go through the loop at
+    # least once. If there's no subfield b, then there's only a single
+    # level of enumeration, so we just add one to it and we're done.
+    if (exists $next->{b}) {
+	$carry = 0;
+    } else {
+	$carry = 1;
+    }
     foreach my $key (reverse('b'..'f')) {
 	my $level;
 	my $pubpat;
@@ -609,6 +617,8 @@
 		last;
 	    }
 
+# 	    printf("# next_enum: no publication pattern, using frequency\n");
+
 	    my $cap = $self->capfield($key);
 	    if ($cap->{RESTART} && $cap->{COUNT}
 		&& ($next->{$key} eq $cap->{COUNT})) {



More information about the open-ils-commits mailing list