Bug 31000

Summary: Use of uninitialized value $record_type in string eq
Product: Koha Reporter: Slava Shishkin <slavashishkin>
Component: ToolsAssignee: Slava Shishkin <slavashishkin>
Status: CLOSED FIXED QA Contact: Victor Grousset/tuxayo <victor>
Severity: enhancement    
Priority: P5 - low CC: david, tomascohen, victor
Version: unspecified   
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 an error message that appears in the system logs every time that Tools > Catalog > Export data (/cgi-bin/koha/tools/export.pl) is accessed. The error message was "AH01215: Use of uninitialized value $record_type in string eq at /kohadevbox/koha/tools/export.pl line 43.: /kohadevbox/koha/tools/export.pl,...".
Version(s) released in:
22.11.00
Bug Depends on:    
Bug Blocks: 25790    
Attachments: Bug 31000: HOTFIX. Warn removal: param record_type can be undef
Bug 31000: HOTFIX. Warn removal: param record_type can be undef
Bug 31000: HOTFIX. Warn removal: param record_type can be undef
Bug 31000: HOTFIX. Warn removal: param record_type can be undef
Bug 31000: Warn removal: param record_type can be undef

Description Slava Shishkin 2022-06-21 10:38:39 UTC

    
Comment 1 Slava Shishkin 2022-06-21 10:45:39 UTC Comment hidden (obsolete)
Comment 2 Slava Shishkin 2022-06-21 10:47:15 UTC
Created attachment 136389 [details] [review]
Bug 31000: HOTFIX. 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 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.
Comment 3 Katrin Fischer 2022-06-25 15:09:06 UTC
Hi Slava, should this be 'needs sign-off'?
Comment 4 Slava Shishkin 2022-06-26 16:25:57 UTC
Hi Katrin,
yep, my bad. It should this be 'needs sign-off'.
Thanks :)
Comment 5 David Nind 2022-06-26 18:10:37 UTC
Created attachment 136557 [details] [review]
Bug 31000: HOTFIX. 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 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>
Comment 6 David Nind 2022-06-26 18:14:39 UTC
Testing notes (using koha-testing-docker):

- The error message appears in this log file: /var/log/koha/kohadev/intranet-error.log
Comment 7 Slava Shishkin 2022-06-27 09:09:51 UTC
Created attachment 136568 [details] [review]
Bug 31000: HOTFIX. 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>
Comment 8 Slava Shishkin 2022-06-27 09:14:20 UTC
David, thanks for the note. I added it to the patch description.
Comment 9 Victor Grousset/tuxayo 2022-07-10 21:30:33 UTC
Created attachment 137459 [details] [review]
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>
Comment 10 Victor Grousset/tuxayo 2022-07-10 21:35:51 UTC
Removed "HOTFIX" from commit message.

qa script happy, code looks good, passing QA :)
Comment 11 Slava Shishkin 2022-07-11 21:21:54 UTC
Thanks, Victor! :)
Comment 12 Tomás Cohen Arazi 2022-07-11 21:23:50 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!