Bugzilla – Attachment 12078 Details for
Bug 8089
Use Koha::Cache everywhere
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8089 : Follow up fixing an error
Bug-8089--Follow-up-fixing-an-error.patch (text/plain), 1.72 KB, created by
Jared Camins-Esakov
on 2012-09-08 14:39:03 UTC
(
hide
)
Description:
Bug 8089 : Follow up fixing an error
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-09-08 14:39:03 UTC
Size:
1.72 KB
patch
obsolete
>From 39e20aa3829150fe90067a2a8e1ef813cd3e08f4 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Sat, 8 Sep 2012 21:31:48 +1200 >Subject: [PATCH] Bug 8089 : Follow up fixing an error >Content-Type: text/plain; charset="UTF-8" > >scalar = grep returns the number of hits >array = grep returns the matches > >We had changed the behaviour so could no longer find any primary keys > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >Tests pass following patch >--- > C4/SQLHelper.pm | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/SQLHelper.pm b/C4/SQLHelper.pm >index e86d2b7..d781220 100644 >--- a/C4/SQLHelper.pm >+++ b/C4/SQLHelper.pm >@@ -234,22 +234,22 @@ Get the Primary Key field names of the table > > sub GetPrimaryKeys($) { > my $tablename=shift; >- my $result; >+ my @result; > my $cache; > if (Koha::Cache->is_cache_active()) { > $cache = Koha::Cache->new(); > if (defined $cache) { >- $result = $cache->get_from_cache("sqlhelper:GetPrimaryKeys:$tablename"); >+ @result = $cache->get_from_cache("sqlhelper:GetPrimaryKeys:$tablename"); > } > } >- unless (defined $result) { >+ unless (@result) { > my $hash_columns=_get_columns($tablename); >- $result = grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns; >+ @result = grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns; > if (Koha::Cache->is_cache_active() && defined $cache) { >- $cache->set_in_cache("sqlhelper:GetPrimaryKeys:$tablename", $result); >+ $cache->set_in_cache("sqlhelper:GetPrimaryKeys:$tablename", @result); > } > } >- return $result; >+ return @result; > } > > >-- >1.7.2.5
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 8089
:
9577
|
9580
|
9581
|
9665
|
9666
|
9673
|
10166
|
10167
|
10168
|
11400
|
11401
|
11402
|
12077
|
12078
|
14765
|
14891
|
14893
|
16551