generating predictions can fail when there's a mismatch between frequency and pattern regularity

Bug #1546666 reported by Galen Charlton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

Consider a serials predication pattern whose code is this:

["0","0","8","1","a","v","b","no","u","10","v","c","i","(year)","j","(month)","w","m","y","pd01","y","cm06/07","y","cm12/01"]

Although the frequency is monthly ($w = m), a pattern regularity value of $y = pd01 cause it to try to advance a day rather than a month when generating new predications, leading the alternate serials interface to hang.

There is also an associated crash like this:

Error: Error: Method error: undefined : *** Call to [open-ils.serial.make_predictions] failed for session [0.417711228733259171455731202854], thread trace [0]:
The 'day' parameter (undef) to DateTime::new was an 'undef', which is not one of the allowed types: scalar
 at /usr/lib/perl5/DateTime.pm line 199
 DateTime::new(undef, 'year', 2015, 'month', 12, 'day', undef) called at /usr/local/share/perl/5.14.2/OpenILS/Utils/MFHD/Date.pm line 73
 MFHD::Date::subsequent_day(01, 'ARRAY(0x45d9988)', 'MFHD::Caption=HASH(0x49b1648)') called at /usr/local/share/perl/5.14.2/OpenILS/Utils/MFHD/Caption.pm line 433
[snip]

Such a pattern is very likely a mistake, but attempt to use it should present a more useful error message.

Evergreen 2.9 (probably master)

Tags: serials
Galen Charlton (gmc)
tags: added: serials
Galen Charlton (gmc)
summary: - generating predications can fail when there's a mismatch between
+ generating predictions can fail when there's a mismatch between
frequency and pattern regularity
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.