[Bug 41940] New: Use of uninitialized value... warnings in circulation.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Bug ID: 41940 Summary: Use of uninitialized value... warnings in circulation.pl Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Circulation Assignee: roman.dolny@jezuici.pl Reporter: roman.dolny@jezuici.pl QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com The warnings: [WARN] Use of uninitialized value $patron_session_confirmation in split at /kohadevbox/koha/circ/circulation.pl line 493. [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /kohadevbox/koha/circ/circulation.pl line 494. [WARN] Use of uninitialized value $session_confirmations in split at /kohadevbox/koha/circ/circulation.pl line 495. appears in the plack-intranet-error.log. To reproduce: 1. Use a fresh KTD, observe plack-intranet-error.log. 2. Have a barcode of existing item. 3. Find any patron and go to "Check out" tab. 4. Check out item. ==> Warnings should appear in plack-intranet-error.log -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #1 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 193940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193940&action=edit Bug 41940: Use of uninitialized value... warnings in circulation.pl The warnings: [WARN] Use of uninitialized value $patron_session_confirmation in split at /kohadevbox/koha/circ/circulation.pl line 493. [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /kohadevbox/koha/circ/circulation.pl line 494. [WARN] Use of uninitialized value $session_confirmations in split at /kohadevbox/koha/circ/circulation.pl line 495. appears in the plack-intranet-error.log. Test plan: ========== 1. Use a fresh KTD, observe plack-intranet-error.log. 2. Have a barcode of existing item. 3. Find any patron and go to "Check out" tab. 4. Check out item. ==> Warnings should appear in plack-intranet-error.log 5. Apply the patch; restart_all. 6. Repeat 2-4 with another barcode. ==> No warnings in plack-intranet-error.log. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Ignatianum University in list of Sponsors| |Cracow Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193940|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 194109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194109&action=edit Bug 41940: Use of uninitialized value... warnings in circulation.pl The warnings: [WARN] Use of uninitialized value $patron_session_confirmation in split at /kohadevbox/koha/circ/circulation.pl line 493. [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /kohadevbox/koha/circ/circulation.pl line 494. [WARN] Use of uninitialized value $session_confirmations in split at /kohadevbox/koha/circ/circulation.pl line 495. appears in the plack-intranet-error.log. Test plan: ========== 1. Use a fresh KTD, observe plack-intranet-error.log. 2. Have a barcode of existing item. 3. Find any patron and go to "Check out" tab. 4. Check out item. ==> Warnings should appear in plack-intranet-error.log 5. Apply the patch; restart_all. 6. Repeat 2-4 with another barcode. ==> No warnings in plack-intranet-error.log. Sponsored-by: Ignatianum University in Cracow Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #3 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- my $patron_match = $borrowernumber == ( $patron_for_session // 0 ); my @conf_keys = split( /\|/, $session_confirmations // '' ); This line is correct but looks a bit unclear to me. Shouldn't we fix it with ternary syntax like this ? my $patron_match = $patron_for_session && ($borrowernumber == $patron_for_session); my @conf_keys = $session_confirmations ? split( /\|/, $session_confirmations) : (); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |baptiste.wojtkowski@biblibr |y.org |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #4 from Roman Dolny <roman.dolny@jezuici.pl> --- (In reply to Baptiste Wojtkowski (bwoj) from comment #3)
my $patron_match = $borrowernumber == ( $patron_for_session // 0 ); my @conf_keys = split( /\|/, $session_confirmations // '' );
This line is correct but looks a bit unclear to me. Shouldn't we fix it with ternary syntax like this ?
my $patron_match = $patron_for_session && ($borrowernumber == $patron_for_session); my @conf_keys = $session_confirmations ? split( /\|/, $session_confirmations) : ();
Baptiste, thank you for checking the code. I'm not a programmer, so I don't see the difference. If you think it's necessary, or if someone else suggests it, I can certainly make the change. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #5 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Hi ! Imo this is easier to maintain with the change I propose, please proceed and I can PQA right after :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #6 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 197782 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197782&action=edit Bug 41940: (follow-up) Syntax corrections Patch from commit 73a5729 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|baptiste.wojtkowski@biblibr |jonathan.druart@gmail.com |e.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194109|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198951 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198951&action=edit Bug 41940: Use of uninitialized value... warnings in circulation.pl The warnings: [WARN] Use of uninitialized value $patron_session_confirmation in split at /kohadevbox/koha/circ/circulation.pl line 493. [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /kohadevbox/koha/circ/circulation.pl line 494. [WARN] Use of uninitialized value $session_confirmations in split at /kohadevbox/koha/circ/circulation.pl line 495. appears in the plack-intranet-error.log. Test plan: ========== 1. Use a fresh KTD, observe plack-intranet-error.log. 2. Have a barcode of existing item. 3. Find any patron and go to "Check out" tab. 4. Check out item. ==> Warnings should appear in plack-intranet-error.log 5. Apply the patch; restart_all. 6. Repeat 2-4 with another barcode. ==> No warnings in plack-intranet-error.log. Sponsored-by: Ignatianum University in Cracow Signed-off-by: David Nind <david@davidnind.com> Bug 41940: (follow-up) Syntax corrections Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197782|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- Patches squashed to ease review. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198951|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #9 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Created attachment 198971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198971&action=edit Bug 41940: Remove uninitialized value warnings in circulation.pl The warnings: [WARN] Use of uninitialized value $patron_session_confirmation in split at /kohadevbox/koha/circ/circulation.pl line 493. [WARN] Use of uninitialized value $patron_for_session in numeric eq (==) at /kohadevbox/koha/circ/circulation.pl line 494. [WARN] Use of uninitialized value $session_confirmations in split at /kohadevbox/koha/circ/circulation.pl line 495. appears in the plack-intranet-error.log. Test plan: ========== 1. Use a fresh KTD, observe plack-intranet-error.log. 2. Have a barcode of existing item. 3. Find any patron and go to "Check out" tab. 4. Check out item. ==> Warnings should appear in plack-intranet-error.log 5. Apply the patch; restart_all. 6. Repeat 2-4 with another barcode. ==> No warnings in plack-intranet-error.log. Sponsored-by: Ignatianum University in Cracow Signed-off-by: David Nind <david@davidnind.com> Bug 41940: (follow-up) Syntax corrections Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #10 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Ty joubu for taking over. I just added my signoff line and updated summary to follow guidelines -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 --- Comment #12 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41940 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to stable |Needs documenting --- Comment #13 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 25.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org