Bug 30816 - Use of uninitialized value in numeric ge (>=) at /usr/share/koha/lib/C4/Serials.pm
Summary: Use of uninitialized value in numeric ge (>=) at /usr/share/koha/lib/C4/Seria...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 20.11
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2022-05-20 07:06 UTC by Katrin Fischer
Modified: 2022-05-20 07:06 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-05-20 07:06:37 UTC
The code here is:

        for(my $i = 0; $i < $count; $i++) {
            if($calc{'X'}) {
                # check if we have to increase the new value.
                $newinnerloop1 += 1;
                if ($newinnerloop1 >= $pattern->{every1}) {
                    $newinnerloop1  = 0;
                    $newlastvalue1 += $pattern->{add1};
                }
                # reset counter if needed.
                $newlastvalue1 = $pattern->{setto1} if ($newlastvalue1 > $pattern->{whenmorethan1});
            }

And above:
$newinnerloop1 = $subscription->{innerloop1} || 0; 

I believe this is caused by subscription_numberpatterns.every1 being NULL. 

The default in the database is NULL, but I haven't tested if this can be set manually from the GUI yet.