Bug 27549

Summary: Warning "use of uninitialized value" on renew.pl
Product: Koha Reporter: Peter Vashchuk <stalkernoid>
Component: CirculationAssignee: Peter Vashchuk <stalkernoid>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, david, fridolin.somers, gmcharlt, kyle.m.hall, nugged, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the cause of unnecessary "use of uninitialized value" warnings in the log files generated by Circulation > Renew (/cgi-bin/koha/circ/renew.pl). This was caused by not taking into account that the "barcode" parameter for this form is initially empty.
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15
Circulation function:
Bug Depends on:    
Bug Blocks: 25790    
Attachments: Bug 27549: "use of uninitialized value" warning on renew.pl
Bug 27549: "use of uninitialized value" warning on renew.pl
Bug 27549: "use of uninitialized value" warning on renew.pl

Description Peter Vashchuk 2021-01-25 15:37:04 UTC

    
Comment 1 Peter Vashchuk 2021-01-25 15:38:17 UTC
Created attachment 115783 [details] [review]
Bug 27549: "use of uninitialized value" warning on renew.pl

On the beginning we have empty "barcode" parameter for this form, but that not taken into account in regular expression  warning emitted: "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47." in renew.pl
Fixed by making $barcode to become an empty string by default.

To reproduce:
    1) Head over to the "Circulation -> Renew" page.
    2) Check intranet-error.log there will be a warning "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47".
    3) Apply the patch, refresh the "Renew" page.
    4) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.
Comment 2 David Nind 2021-01-25 23:30:03 UTC
Created attachment 115795 [details] [review]
Bug 27549: "use of uninitialized value" warning on renew.pl

On the beginning we have empty "barcode" parameter for this form, but that not taken into account in regular expression  warning emitted: "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47." in renew.pl
Fixed by making $barcode to become an empty string by default.

To reproduce:
    1) Head over to the "Circulation -> Renew" page.
    2) Check intranet-error.log there will be a warning "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47".
    3) Apply the patch, refresh the "Renew" page.
    4) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-01-25 23:30:36 UTC
Testing notes:
- When using koha-testing-docker the warnings are logged to /var/log/koha/kohadev/plack-intranet-error.log
Comment 4 Katrin Fischer 2021-01-31 13:04:45 UTC
Created attachment 116098 [details] [review]
Bug 27549: "use of uninitialized value" warning on renew.pl

On the beginning we have empty "barcode" parameter for this form, but that not taken into account in regular expression  warning emitted: "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47." in renew.pl
Fixed by making $barcode to become an empty string by default.

To reproduce:
    1) Head over to the "Circulation -> Renew" page.
    2) Check intranet-error.log there will be a warning "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47".
    3) Apply the patch, refresh the "Renew" page.
    4) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2021-02-01 16:27:15 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-02-05 16:14:05 UTC
Pushed to 20.11.x for 20.11.03
Comment 7 Andrew Fuerste-Henry 2021-02-09 21:31:26 UTC
Pushed to 20.05.x for 20.05.09
Comment 8 Victor Grousset/tuxayo 2021-02-11 05:44:28 UTC
Backported: Pushed to 19.11.x branch for 19.11.15