Bugzilla – Attachment 82983 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.59 KB, created by
Fridolin Somers
on 2018-12-07 15:41:50 UTC
(
hide
)
Description:
Bug 21975: get item field in substitutions
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2018-12-07 15:41:50 UTC
Size:
1.59 KB
patch
obsolete
>From 6416d1dc62a01f3aeb8ae86433e105e2b2004d3c 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 >--- > C4/Items.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 3b006c686e..3fd872b091 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2651,6 +2651,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| >@@ -2688,7 +2691,7 @@ sub ToggleNewStatus { > my $item = C4::Items::GetItem( $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.17.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