Bugzilla – Attachment 34785 Details for
Bug 11023
Automatic item modification by age (Was "Toggle new status for items")
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11023: FIX - condition on biblioitems table does not work
Bug-11023-FIX---condition-on-biblioitems-table-doe.patch (text/plain), 2.55 KB, created by
Jonathan Druart
on 2014-12-29 10:22:25 UTC
(
hide
)
Description:
Bug 11023: FIX - condition on biblioitems table does not work
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-12-29 10:22:25 UTC
Size:
2.55 KB
patch
obsolete
>From e83a8e5153f71fe07e3fa8ff96644c972367173b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 3 Mar 2014 15:59:30 +0100 >Subject: [PATCH] Bug 11023: FIX - condition on biblioitems table does not work > >If a rule contains a condition on the biblioitems table, the match won't >work. This patch fixes this issue. >--- > C4/Items.pm | 2 +- > t/db_dependent/Items/ToggleNewStatus.t | 25 ++++++++++++++++++++++++- > 2 files changed, 25 insertions(+), 2 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 0036ede..962ea29 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -3144,7 +3144,7 @@ sub ToggleNewStatus { > my $query = q| > SELECT items.biblionumber, items.itemnumber > FROM items >- LEFT JOIN biblioitems ON items.biblioitemnumber = items.itemnumber >+ LEFT JOIN biblioitems ON biblioitems.biblionumber = items.biblionumber > WHERE 1 > |; > for my $condition ( @$conditions ) { >diff --git a/t/db_dependent/Items/ToggleNewStatus.t b/t/db_dependent/Items/ToggleNewStatus.t >index 8ea14f7..40d8e4a 100644 >--- a/t/db_dependent/Items/ToggleNewStatus.t >+++ b/t/db_dependent/Items/ToggleNewStatus.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 15; >+use Test::More tests => 16; > use MARC::Record; > use MARC::Field; > use DateTime; >@@ -31,6 +31,7 @@ my $record = MARC::Record->new(); > $record->append_fields( > MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), > MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'), >+ MARC::Field->new('942', ' ', ' ', c => 'ITEMTYPE_T'), > ); > my ($biblionumber, undef) = C4::Biblio::AddBiblio($record, ''); > >@@ -258,3 +259,25 @@ C4::Items::ToggleNewStatus( { rules => \@rules } ); > $modified_item = C4::Items::GetItem( $itemnumber ); > is( $modified_item->{new}, 'new_updated_value', q|ToggleNewStatus: conditions multiple: the 2 conditions match, the new value is updated|); > >+@rules = ( >+ { >+ conditions => [ >+ { >+ field => 'biblioitems.itemtype', >+ value => 'ITEMTYPE_T', >+ }, >+ ], >+ substitutions => [ >+ { >+ field => 'items.new', >+ value => 'another_new_updated_value', >+ }, >+ ], >+ duration => '0', >+ }, >+); >+ >+C4::Items::ToggleNewStatus( { rules => \@rules } ); >+ >+$modified_item = C4::Items::GetItem( $itemnumber ); >+is( $modified_item->{new}, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|); >-- >2.1.0
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 11023
:
21926
|
21932
|
21982
|
21983
|
22004
|
22386
|
22734
|
22735
|
24068
|
24069
|
24070
|
24146
|
24147
|
24148
|
25767
|
25833
|
26817
|
26818
|
26819
|
26820
|
26821
|
26822
|
26855
|
27810
|
29216
|
29217
|
29218
|
29219
|
29220
|
29221
|
29222
|
31820
|
31821
|
31822
|
33226
|
33227
|
33228
|
33229
|
33230
|
33231
|
33232
|
33233
|
33234
|
33235
|
34782
|
34783
|
34784
|
34785
|
34786
|
34787
|
34788
|
34789
|
34790
|
34791
|
34870
|
34871
|
34872
|
34873
|
34874
|
34875
|
34876
|
34877
|
34878
|
34879
|
34880
|
34881
|
34882
|
34883
|
35375
|
35376
|
41147
|
41148