Bug 30816

Summary: Use of uninitialized value in numeric ge (>=) at /usr/share/koha/lib/C4/Serials.pm
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: 20.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 25790    

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.