Bugzilla – Attachment 87575 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: get item field in substitutions
Bug-21975-get-item-field-in-substitutions.patch (text/plain), 1.65 KB, created by
Martin Renvoize (ashimema)
on 2019-04-09 06:27:59 UTC
(
hide
)
Description:
Bug 21975: get item field in substitutions
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-09 06:27:59 UTC
Size:
1.65 KB
patch
obsolete
>From f2c40077ddbbaac99e8baf8d6aa0ec37ae3237bf Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 7 Dec 2018 15:58:54 +0100 >Subject: [PATCH] Bug 21975: get item field in substitutions > >substitutions field stores the item field with 'items.' prefix. >Looks like call of C4::Items::ModItem() works but it will not if ORM object is used in the futur. >So I prefer fix it now and it is needed for main patch. > >Test plan : >Run t/db_dependent/Items/AutomaticItemModificationByAge.t > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Items.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 547d8358c9..66ce7af00e 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2604,6 +2604,9 @@ sub ToggleNewStatus { > my $age = $rule->{age}; > my $conditions = $rule->{conditions}; > my $substitutions = $rule->{substitutions}; >+ foreach ( @$substitutions ) { >+ ( $_->{item_field} ) = ( $_->{field} =~ /items\.(.*)/ ); >+ } > my @params; > > my $query = q| >@@ -2640,7 +2643,7 @@ sub ToggleNewStatus { > my $itemnumber = $values->{itemnumber}; > for my $substitution ( @$substitutions ) { > next unless $substitution->{field}; >- C4::Items::ModItem( {$substitution->{field} => $substitution->{value}}, $biblionumber, $itemnumber ) >+ 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