In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down.
Created attachment 111167 [details] [review] Bug 26604: "Generate next" button gives error on serials-collection.pl In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down.
Test Plan: 1. Create a serial 2 Have a serial with a frequency set for this serial. 3. Receive some serials. 4. Attempt to generate the next issue, get a software error.
Created attachment 111168 [details] [review] Bug 26604: "Generate next" button gives error on serials-collection.pl In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down.
Kyle, error while testing: Could not compile /kohadevbox/koha/serials/serials-collection.pl: Global symbol "$frequency" requires explicit package name (did you forget to declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl line 80. Global symbol "$frequency" requires explicit package name (did you forget to declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl line 85. Global symbol "$frequency" requires explicit package name (did you forget to declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl line 88. BEGIN not safe after errors--compilation aborted at /kohadevbox/koha/serials/serials-collection.pl line 218. at /usr/share/perl5/CGI/Compile.pm line 132
(In reply to Kelly McElligott from comment #4) > Kyle, error while testing: > > Could not compile /kohadevbox/koha/serials/serials-collection.pl: Global > symbol "$frequency" requires explicit package name (did you forget to > declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl > line 80. > Global symbol "$frequency" requires explicit package name (did you forget to > declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl > line 85. > Global symbol "$frequency" requires explicit package name (did you forget to > declare "my $frequency"?) at /kohadevbox/koha/serials/serials-collection.pl > line 88. > BEGIN not safe after errors--compilation aborted at > /kohadevbox/koha/serials/serials-collection.pl line 218. > at /usr/share/perl5/CGI/Compile.pm line 132 I caught that and uploaded a fresh version of the patch! Can you try again?
Created attachment 111171 [details] [review] Bug 26604: "Generate next" button gives error on serials-collection.pl In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down. Signed-off-by: kelly mcelligott <kelly@bywatersolutions.com>
Odd.. has this really not been working since 19.05! It looks like it was introduced with bug 17047
Created attachment 111242 [details] [review] Bug 26604: "Generate next" button gives error on serials-collection.pl In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down. Signed-off-by: kelly mcelligott <kelly@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected, passing QA
I don't recreate the problem, can you provide me a more detailed test plan please?
(In reply to Kelly McElligott from comment #2) > Test Plan: > 2 Have a serial with a frequency set for this serial. => This is mandatory when you create a new subscription. Do I have a set something else? > 3. Receive some serials. How? One by one, multi receiving? Which status? > 4. Attempt to generate the next issue, get a software error. https://snipboard.io/mih40L.jpg It generates ok for me
Jonathan, 1. Receive serial in any fashion. 2. Attempt to generate the next issue- error. Upon looking at this further, the library's serial was not generating issue numbers. They had the frequency and starting issue in the subscription ,but Koha was not filling in this issue number- I re-edited the subscription and saved it, then the issue numbers started and the generate next worked.
Ok, I managed to recreate it. This is very tricky. Test plan: 1. Create a new subscription * When there is an irregular issue: Skip issue number * Select a frequency (not irregular) * Test prediction pattern and mark some "not published" (to fill the subscription.irregular DB field 2. Receive a first serial (mark it arrived, an "expected" one is created) 3. Claim the expected one => You have 1 arrived and 1 claimed. It's the only way to not have an expected one and hit the else block in serials/serials-collection.pl 4. Generate next => boom
Created attachment 111399 [details] [review] Bug 26604: "Generate next" button gives error on serials-collection.pl In serials-collection.pl, the line $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); causes the error Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198. This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down. Signed-off-by: kelly mcelligott <kelly@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> JD Test plan: 1. Create a new subscription * When there is an irregular issue: Skip issue number * Select a frequency (not irregular) * Test prediction pattern and mark some "not published" (to fill the subscription.irregular DB field 2. Receive a first serial (mark it arrived, an "expected" one is created) 3. Claim the expected one => You have 1 arrived and 1 claimed. It's the only way to not have an expected one and hit the else block in serials/serials-collection.pl 4. Generate next => boom Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.06
backported to 19.11.x for 19.11.12
Backported to 19.05.x branch for 19.05.17