Bugzilla – Attachment 44119 Details for
Bug 14100
Add base to make item types, branch names, sysprefs values and authorised values translatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14100: Fix Search.t tests
Bug-14100-Fix-Searcht-tests.patch (text/plain), 2.28 KB, created by
Jonathan Druart
on 2015-10-28 10:55:48 UTC
(
hide
)
Description:
Bug 14100: Fix Search.t tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-28 10:55:48 UTC
Size:
2.28 KB
patch
obsolete
>From 91d5ade709536ba27cb87e58ab10bb3386da016b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 28 Oct 2015 10:43:55 +0000 >Subject: [PATCH] Bug 14100: Fix Search.t tests > >So, this one is VERY weird, let me try to explain what I have >understood. > >Bisecting using run prove t/db_dependent/Search.t, I have found that the >following commit make the test fail: > commit 0f63f89f66e40cc01ef02da3654fcfb404c9001d > Bug 14100: Generic solution for language overlay - Item types >The error is > DBI bind_columns: invalid number of arguments: got handle + 0, expected handle + between 1 and -1 > Usage: $h->bind_columns(\$var1 [, \$var2, ...]) at /usr/lib/i386-linux-gnu/perl5/5.20/DBI.pm line 2065. > >Note that the interface (admin/itemtypes.pl) which calls the same >subroutine with the same parameter (style => 'array') works great. > >The problem comes from the change in C4::Search::searchResults, if I >only apply the change done to this subroutine on 0f63f89f^1, I reproduce >the issue. > >Looking closely at how %itemtypes is built, we could actually call >GetItemTypes with the style => 'hash' to get exactly what we want. >The following piece prove it for you: > use Test::More; > use C4::Koha; > my $i = GetItemTypes; > my $j = GetItemTypes(style => 'array'); > my %itemtypes; > for my $itemtype ( @$j ) { > $itemtypes{ $itemtype->{itemtype} } = $itemtype; > } > is_deeply( \%itemtypes, $i); > >So changing the code accordingly and just forget this last hour... >--- > C4/Search.pm | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 5c11862..a871586 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1870,13 +1870,8 @@ sub searchResults { > # get notforloan authorised value list (see $shelflocations FIXME) > my $notforloan_authorised_value = GetAuthValCode('items.notforloan',''); > >- #Build itemtype hash >- #find itemtype & itemtype image >- my %itemtypes; >- my $itemtypes = GetItemTypes( style => 'array' ); >- for my $itemtype ( @$itemtypes ) { >- $itemtypes{ $itemtype->{itemtype} } = $itemtype; >- } >+ #Get itemtype hash >+ my %itemtypes = %{ GetItemTypes() }; > > #search item field code > my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" ); >-- >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 14100
:
38727
|
40917
|
40965
|
41654
|
41659
|
41660
|
42525
|
42526
|
43110
|
43111
|
43365
|
43366
|
43367
|
43368
|
43369
|
43370
|
43394
|
43395
|
43396
|
43577
|
43602
|
43603
|
43604
|
43605
|
43606
|
43613
|
44085
|
44086
|
44087
|
44088
|
44089
|
44090
|
44094
|
44108
|
44109
| 44119 |
44151