Bugzilla – Attachment 44003 Details for
Bug 14778
DBIC should create/own the DB handler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14778: Make Search.t pass - replace SHOW COLUMNS
Bug-14778-Make-Searcht-pass---replace-SHOW-COLUMNS.patch (text/plain), 1.19 KB, created by
Jonathan Druart
on 2015-10-26 14:00:59 UTC
(
hide
)
Description:
Bug 14778: Make Search.t pass - replace SHOW COLUMNS
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-26 14:00:59 UTC
Size:
1.19 KB
patch
obsolete
>From 8d3bb4ebc1993702808e0367b5e8c0df02bbeed1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 26 Oct 2015 13:59:06 +0000 >Subject: [PATCH] Bug 14778: Make Search.t pass - replace SHOW COLUMNS > >For an unkown reason, when executed from a test file, the 'SHOW COLUMNS' >statement does not return anything. >We need to retrieve the column list from the DBIx::Class resultset. >--- > C4/Search.pm | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index e0f34bf..1a8bba0 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1889,10 +1889,9 @@ sub searchResults { > my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" ); > > ## find column names of items related to MARC >- my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items"); >- $sth2->execute; > my %subfieldstosearch; >- while ( ( my $column ) = $sth2->fetchrow ) { >+ my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; >+ for my $column ( @columns ) { > my ( $tagfield, $tagsubfield ) = > &GetMarcFromKohaField( "items." . $column, "" ); > if ( defined $tagsubfield ) { >-- >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 14778
:
42326
|
42388
|
43247
|
43248
|
43249
|
43250
|
43440
|
43631
|
43632
|
43633
|
43634
|
43635
|
43636
|
43637
|
43638
|
43639
|
43640
|
43641
|
43642
|
43643
|
43644
|
43645
|
43834
|
43835
|
43836
|
43837
|
43838
|
43839
|
43840
|
43841
|
43842
|
43843
|
43844
|
43845
|
43846
|
43847
|
43848
|
43849
|
43850
|
43851
|
43852
|
43853
|
43857
|
43858
|
43859
|
43860
|
43861
|
43862
|
43863
|
43864
|
43865
|
43866
|
43867
|
43868
|
43869
|
43870
|
43871
|
43872
|
43873
|
43874
|
43875
|
43876
| 44003