Bugzilla – Attachment 133901 Details for
Bug 30366
Warn when running automatic_item_modification_by_age.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl
Bug-30366-Remove-warn-when-running-automaticitemmo.patch (text/plain), 1.69 KB, created by
Martin Renvoize (ashimema)
on 2022-04-26 13:56:08 UTC
(
hide
)
Description:
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-04-26 13:56:08 UTC
Size:
1.69 KB
patch
obsolete
>From 2a46ff423e2499d893c70574b5fa52ae38f5c600 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 25 Apr 2022 10:27:54 -1000 >Subject: [PATCH] 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> >--- > C4/Items.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Items.pm b/C4/Items.pm >index a7f06dd876..65bf8bc971 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1858,6 +1858,7 @@ sub ToggleNewStatus { > WHERE 1 > |; > for my $condition ( @$conditions ) { >+ next unless $condition->{field}; > if ( > grep { $_ eq $condition->{field} } @item_columns > or grep { $_ eq $condition->{field} } @biblioitem_columns >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30366
:
133844
|
133899
| 133901