Bugzilla – Attachment 97895 Details for
Bug 23463
Move C4::Items CRUD subroutines to Koha::Item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23463: Replace SearchItemsByField by SearchItems
Bug-23463-Replace-SearchItemsByField-by-SearchItem.patch (text/plain), 2.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-24 19:44:42 UTC
(
hide
)
Description:
Bug 23463: Replace SearchItemsByField by SearchItems
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-24 19:44:42 UTC
Size:
2.31 KB
patch
obsolete
>From 68e991ff55200b0b460edc61c713f07971ad966a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 17 Mar 2019 21:09:29 -0300 >Subject: [PATCH] Bug 23463: Replace SearchItemsByField by SearchItems > >The subroutine SearchItemsByField is only called once and can be >replaced easily with SearchItems > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > acqui/check_uniqueness.pl | 2 +- > t/db_dependent/Items.t | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/acqui/check_uniqueness.pl b/acqui/check_uniqueness.pl >index 70d95ddd7b..8b36e68af6 100755 >--- a/acqui/check_uniqueness.pl >+++ b/acqui/check_uniqueness.pl >@@ -43,7 +43,7 @@ my @value = $input->multi_param('value[]'); > my $r = {}; > my $i = 0; > for ( my $i=0; $i<@field; $i++ ) { >- my $items = C4::Items::SearchItemsByField($field[$i], $value[$i]); >+ my ($items) = C4::Items::SearchItems({ field => $field[$i], query => $value[$i]}); > > if ( @$items ) { > push @{ $r->{$field[$i]} }, $value[$i]; >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 7d71b4e655..cebe3a77c1 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -385,7 +385,7 @@ subtest 'SearchItems test' => sub { > }); > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); >- my $cpl_items_before = SearchItemsByField( 'homebranch', $library1->{branchcode}); >+ my ($cpl_items_before) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); > > my $biblio = $builder->build_sample_biblio({ title => 'Silence in the library' }); > $builder->build_sample_biblio({ title => 'Silence in the shadow' }); >@@ -541,8 +541,8 @@ subtest 'SearchItems test' => sub { > ($items, $total_results) = SearchItems($filter); > ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); > >- my $cpl_items_after = SearchItemsByField( 'homebranch', $library1->{branchcode}); >- is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' ); >+ my ($cpl_items_after) = SearchItems( { field => 'homebranch', query => $library1->{branchcode} } ); >+ is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItems should return something' ); > > # Issues count may be NULL > $filter = { >-- >2.25.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 23463
:
95899
|
95900
|
95901
|
95902
|
95903
|
95904
|
95905
|
95906
|
95907
|
95908
|
95909
|
95910
|
95911
|
95912
|
95913
|
95914
|
95915
|
95916
|
95917
|
95918
|
95919
|
95920
|
95921
|
95922
|
95923
|
95925
|
96145
|
97895
|
97896
|
97897
|
97898
|
97899
|
97900
|
97901
|
97902
|
97903
|
97904
|
97905
|
97906
|
97907
|
97908
|
97909
|
97910
|
97911
|
97912
|
97913
|
97914
|
97915
|
97916
|
97917
|
97918
|
97919
|
97920
|
97921
|
101151
|
101152
|
101153
|
101154
|
101156
|
101157
|
101158
|
101161
|
101163
|
101165
|
101167
|
101169
|
101170
|
101171
|
101172
|
101173
|
101174
|
101175
|
101176
|
101177
|
101178
|
101179
|
101180
|
101181
|
101182
|
101183
|
101184
|
101185
|
101186
|
101188
|
101189
|
101190
|
101191
|
101192
|
101193
|
101194
|
101195
|
101196
|
101197
|
101246
|
101247
|
101248
|
101249
|
101250
|
101251
|
101252
|
101253
|
101254
|
101255
|
101256
|
101257
|
101258
|
101259
|
101260
|
101261
|
101262
|
101263
|
101264
|
101265
|
101266
|
101267
|
101268
|
101269
|
101270
|
101271
|
101272
|
101273
|
101274
|
101275
|
101276
|
101277
|
101278
|
101279
|
101280
|
101281
|
101282
|
101283
|
101284
|
101413
|
101414
|
101415
|
101416
|
101432
|
101476
|
102071
|
103129
|
113581