Bugzilla – Attachment 87881 Details for
Bug 21975
Unnecessary substitutions in automatic item modification by age
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21975: Avoid unnecessary substitutions in automatic item modification by age
Bug-21975-Avoid-unnecessary-substitutions-in-autom.patch (text/plain), 1.61 KB, created by
Martin Renvoize (ashimema)
on 2019-04-12 11:57:04 UTC
(
hide
)
Description:
Bug 21975: Avoid unnecessary substitutions in automatic item modification by age
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-12 11:57:04 UTC
Size:
1.61 KB
patch
obsolete
>From 8cfa0b283b7d86fcc5f3943ee390bb67eff47a85 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 7 Dec 2018 16:05:52 +0100 >Subject: [PATCH] Bug 21975: Avoid unnecessary substitutions in automatic item > modification by age > >Automatic item modification by age cronjob is based on rules with conditions and substitutions. >When substitution value is equal to actual item value, the code should not call C4::Items::ModItem. It adds unnecessary action log and entry in zebraqueue. >With a rule than can impact all catalogue you can explode your database with action logs. > >Test plan : >1) Run prove t/db_dependent/Items/AutomaticItemModificationByAge.t >2) Define a item modification by age with no condition >3) Run several times misc/cronjobs/automatic_item_modification_by_age.pl >4) Check it creates only one entry in action_logs and zebraqueue > >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 66ce7af00e..dcbf4aef94 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2643,6 +2643,7 @@ sub ToggleNewStatus { > my $itemnumber = $values->{itemnumber}; > for my $substitution ( @$substitutions ) { > next unless $substitution->{field}; >+ next if ( $item->{ $substitution->{item_field} } eq $substitution->{value} ); > C4::Items::ModItem( { $substitution->{item_field} => $substitution->{value} }, $biblionumber, $itemnumber ) > unless $report_only; > push @{ $report->{$itemnumber} }, $substitution; >-- >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 21975
:
82983
|
82984
|
82985
|
87575
|
87576
|
87577
|
87876
|
87877
|
87879
|
87880
|
87881
|
87882
|
87883
|
87889
|
87890
|
87891
|
87892
|
87893