Bugzilla – Attachment 151465 Details for
Bug 32060
Improve performance of Koha::Item->columns_to_str
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32060: Use selectrow_array
Bug-32060-Use-selectrowarray.patch (text/plain), 1.74 KB, created by
Marcel de Rooy
on 2023-05-19 09:36:39 UTC
(
hide
)
Description:
Bug 32060: Use selectrow_array
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-19 09:36:39 UTC
Size:
1.74 KB
patch
obsolete
>From 842b1a084938facdf55822980167fb1c56e71054 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 May 2023 16:36:26 +0200 >Subject: [PATCH] Bug 32060: Use selectrow_array >Content-Type: text/plain; charset=utf-8 > >Trivial ergonomic patch, use selectrow_array, no need to prepare the >query > >+ perltidy the sub > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Biblio.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index fb912055bd..4df747474a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1831,15 +1831,15 @@ sub UpsertMarcControlField { > > sub GetFrameworkCode { > my ($biblionumber) = @_; >- my $cache = Koha::Cache::Memory::Lite->get_instance(); >- my $cache_key = "FrameworkCode-$biblionumber"; >- my $frameworkcode = $cache->get_from_cache($cache_key); >- unless (defined $frameworkcode) { >+ my $cache = Koha::Cache::Memory::Lite->get_instance(); >+ my $cache_key = "FrameworkCode-$biblionumber"; >+ my $frameworkcode = $cache->get_from_cache($cache_key); >+ unless ( defined $frameworkcode ) { > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT frameworkcode FROM biblio WHERE biblionumber=?"); >- $sth->execute($biblionumber); >- ($frameworkcode) = $sth->fetchrow; >- $cache->set_in_cache($cache_key, $frameworkcode); >+ ($frameworkcode) = $dbh->selectrow_array( >+ "SELECT frameworkcode FROM biblio WHERE biblionumber=?", >+ undef, $biblionumber ); >+ $cache->set_in_cache( $cache_key, $frameworkcode ); > } > return $frameworkcode; > } >-- >2.30.2
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 32060
:
142894
|
144348
|
150866
|
151131
|
151132
|
151133
|
151291
|
151292
|
151464
| 151465