From 9f731c77584b35693a836cefdf6c2b990122f16e Mon Sep 17 00:00:00 2001 From: djfiander Date: Tue, 11 Aug 2009 16:10:14 +0000 Subject: [PATCH] Deal with a publication that only has a single level of enumeration (ie, only volume numbers). git-svn-id: svn://svn.open-ils.org/ILS/trunk@13808 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm b/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm index 5a2b8b91ca..646992a13f 100755 --- a/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/MFHD/Caption.pm @@ -541,7 +541,15 @@ sub next_enum { # 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 @@ sub next_enum { 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})) { -- 2.11.0