Bug 27548: "use of uninitialized value" warning on branchoverdues.pl
authorPetro Vashchuk <stalkernoid@gmail.com>
Mon, 25 Jan 2021 15:35:18 +0000 (17:35 +0200)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Thu, 11 Feb 2021 05:40:15 +0000 (06:40 +0100)
commit8f4dbfbf50cb027a133c28e5240a5c1c996e648d
tree57767ba3621904894e9b931eb7c9148c22f00ad5
parentd4ab4fe8dcb4a6f91917dc13bfe176419560725d
Bug 27548: "use of uninitialized value" warning on branchoverdues.pl

On the beginning we have empty "location" parameter for this form,
but that not taken into account in comparison and undef warning emitted:
"Use of uninitialized value $location in string eq at
/usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72" in branchoverdues.pl

Fixed by adding pre-check for $location.

To reproduce:
    1) Head over to "Circulation ->Overdues with fines" page. Check
       intranet-error.log where there will be many warnings
       "Use of uninitialized value $location in string eq at /usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72".
    2) Apply the patch, refresh the "Overdues with fines" page.
    3) 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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c3d22687568640930bad9ffbb426033423e7efe9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 44d1675aaf1e602e12ccd669dad50a299654f89d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit d766debe2c80bf991145e413308ef1a8b298286e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
circ/branchoverdues.pl