Bug 31000: Warn removal: param record_type can be undef
authorAndrew Nugged <nugged@gmail.com>
Fri, 26 Nov 2021 11:45:37 +0000 (13:45 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 11 Jul 2022 21:20:15 +0000 (18:20 -0300)
commit797ebc65e800a333b5c3432429ff128454e7efaf
tree1b8c29bc4f3c1ef76b87bb2d8994996c4cec367e
parent2f668f0b187c4a421b1ffa862e1c40553e8ab786
Bug 31000: Warn removal: param record_type can be undef

Uninitialized value warning on /tools/export.pl when $record_type is undef

Use of uninitialized value $record_type in string eq
at /home/vagrant/kohaclone/tools/export.pl line 43.

This warning in koha-testing-docker appears in:
/var/log/koha/kohadev/intranet-error.log

This patch fixes it by working when $record_type is Undef.
The functionality still remains the same but warning doesn't flood
error log.
To reproduce:
1. Go to export data tool page (/tools/export.pl).
2. Check the error log and find the upper mentioned warning,
check the timestamp to ensure that it was added when you loaded the page.
3. Apply the patch.
4. Load the page again, ensure that the same warning doesn't get added
to the log file again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tools/export.pl