Bugzilla – Attachment 50792 Details for
Bug 12721
Prevent software error if incorrect fieldnames given in sypref StatisticsFields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12721: (followup) Replace mysqlism by DBIx::Class
Bug-12721-followup-Replace-mysqlism-by-DBIxClass.patch (text/plain), 1.19 KB, created by
Marc Véron
on 2016-04-27 10:41:55 UTC
(
hide
)
Description:
Bug 12721: (followup) Replace mysqlism by DBIx::Class
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-04-27 10:41:55 UTC
Size:
1.19 KB
patch
obsolete
>From 2eb6847d1c7f60c63186a677ad14651e088a07d4 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Wed, 27 Apr 2016 12:38:58 +0200 >Subject: [PATCH] Bug 12721: (followup) Replace mysqlism by DBIx::Class > >This patch removes the mysqlism (see comment #18) >--- > C4/Members/Statistics.pm | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > >diff --git a/C4/Members/Statistics.pm b/C4/Members/Statistics.pm >index c491819..9ca801e 100644 >--- a/C4/Members/Statistics.pm >+++ b/C4/Members/Statistics.pm >@@ -59,14 +59,11 @@ sub get_fields { > if ( $syspref ) { > my @ret; > my @spfields = split ('\|', $syspref); >- my $dbh=C4::Context->dbh; >- my $sth = $dbh->prepare('SHOW COLUMNS FROM items'); >- $sth->execute; >- my $dbfields = $sth->fetchall_hashref('Field'); >- $sth->finish(); >+ my $schema = Koha::Database->new()->schema(); >+ my @columns = $schema->source('Item')->columns; > > foreach my $fn ( @spfields ) { >- push ( @ret, $fn ) if ( $dbfields->{ $fn } ); >+ push ( @ret, $fn ) if ( grep(/^$fn$/, @columns) ); > } > $ret = join( '|', @ret); > } >-- >1.7.10.4
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 12721
:
43573
|
43575
|
44316
|
50622
|
50668
|
50669
|
50792
|
50855
|
50897
|
50898
|
50899
|
50900