]> git.koha-community.org Git - koha.git/commit
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl
authorFridolin Somers <fridolin.somers@biblibre.com>
Mon, 25 Apr 2022 20:27:54 +0000 (10:27 -1000)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 13 May 2022 15:46:46 +0000 (11:46 -0400)
commitee4d5a250689d7310e94432105a8cb99329e2a2a
tree44e57610c6883cdcb7f2e6bc2b079df34d1b1833
parent5f543cf407c61b19dda6f9647c62606f36b044df
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl

When using the ./misc/cronjobs/automatic_item_modification_by_age.pl -v
after setting up rules under Tools > Automatic item modifications by
age the script outputs several lines of warnings:

Use of uninitialized value in string eq at /kohadevbox/koha/C4/Items.pm
line 1864.

This is because even when there is no condition defined, modification
rule is stored with empty hash, like :
[{"substitutions":[{"field":"items.new_status","value":"0"}],"conditions":[{}],"age":"60","agefield":"items.dateaccessioned"}]

Test plan :
1) Go to Tools > Automatic item modifications by age
2) Create a rule with no conditions, just a substitution
3) Run misc/cronjobs/automatic_item_modification_by_age.pl -v
4) Check there is no warning
5) Edit the rule to add a condition
6) Run misc/cronjobs/automatic_item_modification_by_age.pl -v
7) Check the condition is applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Items.pm