Bug 26784 - Editing a MARC modification template is noisy
Summary: Editing a MARC modification template is noisy
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-22 12:36 UTC by Nick Clemens
Modified: 2020-11-17 20:43 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06


Attachments
Bug 26784: Silence warns about comparing undefined values for MARC modification templates (2.73 KB, patch)
2020-10-22 12:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26784: Silence warns about comparing undefined values for MARC modification templates (2.79 KB, patch)
2020-10-24 21:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 26784: Silence warns about comparing undefined values for MARC modification templates (2.84 KB, patch)
2020-10-25 00:21 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-10-22 12:36:08 UTC
To recreate:
1 - Define several actions for a MARC modification template
2 - Ensure you have actions with no conditionals
3 - Tail the intranet logs
4 - Browse to Tools->MARC modification templates
5 - Click 'Edit actions' for the template you setup above
6 - Note warns like:
    [2020/10/22 12:30:18] [WARN] Use of uninitialized value in string eq at /kohadevbox/koha/tools/marc_modification_templates.pl line 127.
Comment 1 Nick Clemens 2020-10-22 12:38:39 UTC
Created attachment 112187 [details] [review]
Bug 26784: Silence warns about comparing undefined values for MARC modification templates

This patch simply checks if conditionals are defined before comparing

We don't need to check actions because you cannot save an action without an action :-)

To test:
1 - Define several actions for a MARC modification template
2 - Ensure you have actions with no conditionals
3 - Tail the intranet logs
4 - Browse to Tools->MARC modification templates
5 - Click 'Edit actions' for the template you setup above
6 - Note warns like:
    [2020/10/22 12:30:18] [WARN] Use of uninitialized value in string eq at /kohadevbox/koha/tools/marc_modification_templates.pl line 127.
7 - Apply patch
8 - Restart all the things
9 - Edit actions again and note no more warns
Comment 2 Chris Cormack 2020-10-24 21:56:40 UTC
Created attachment 112408 [details] [review]
Bug 26784: Silence warns about comparing undefined values for MARC modification templates

This patch simply checks if conditionals are defined before comparing

We don't need to check actions because you cannot save an action without an action :-)

To test:
1 - Define several actions for a MARC modification template
2 - Ensure you have actions with no conditionals
3 - Tail the intranet logs
4 - Browse to Tools->MARC modification templates
5 - Click 'Edit actions' for the template you setup above
6 - Note warns like:
    [2020/10/22 12:30:18] [WARN] Use of uninitialized value in string eq at /kohadevbox/koha/tools/marc_modification_templates.pl line 127.
7 - Apply patch
8 - Restart all the things
9 - Edit actions again and note no more warns

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 3 Katrin Fischer 2020-10-25 00:21:29 UTC
Created attachment 112432 [details] [review]
Bug 26784: Silence warns about comparing undefined values for MARC modification templates

This patch simply checks if conditionals are defined before comparing

We don't need to check actions because you cannot save an action without an action :-)

To test:
1 - Define several actions for a MARC modification template
2 - Ensure you have actions with no conditionals
3 - Tail the intranet logs
4 - Browse to Tools->MARC modification templates
5 - Click 'Edit actions' for the template you setup above
6 - Note warns like:
    [2020/10/22 12:30:18] [WARN] Use of uninitialized value in string eq at /kohadevbox/koha/tools/marc_modification_templates.pl line 127.
7 - Apply patch
8 - Restart all the things
9 - Edit actions again and note no more warns

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-10-25 23:10:21 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-11-13 20:54:59 UTC
backported to 20.05.x for 20.05.06
Comment 6 Aleisha Amohia 2020-11-17 04:43:37 UTC
enhancement, not backported to 19.11.x