Summary: | Warn when running automatic_item_modification_by_age.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Installation and upgrade (command-line installer) | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | fridolin.somers, kyle, martin.renvoize, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Martin Renvoize | Documentation submission: | |
Text to go in the release notes: | Version(s) released in: |
22.05.00,21.11.06
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 25790 | ||
Attachments: |
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl Bug 30366: Remove warn when running automatic_item_modification_by_age.pl |
Description
Katrin Fischer
2022-03-26 23:31:25 UTC
Created attachment 133844 [details] [review] 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 Created attachment 133899 [details] [review] 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> Created attachment 133901 [details] [review] 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> Trivial and clear fix, works as expected, no regressions found and QA scripts happy. PQA Pushed to master for 22.05, thanks to everybody involved [U+1F984] Pushed to 21.11.x for 21.11.06 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Warning cleanup, no documentation change required. |