Bugzilla – Attachment 81865 Details for
Bug 21015
Members.pm slow because it loads twice Koha::Schema
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21015: fix performance issue with C4::Members
Bug-21015-fix-performance-issue-with-C4Members.patch (text/plain), 1.56 KB, created by
Marcel de Rooy
on 2018-11-02 07:11:06 UTC
(
hide
)
Description:
Bug 21015: fix performance issue with C4::Members
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-11-02 07:11:06 UTC
Size:
1.56 KB
patch
obsolete
>From 33d141755f0e4924ecc8e1f0c6ac92692e511246 Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Fri, 29 Jun 2018 11:09:41 +0300 >Subject: [PATCH] Bug 21015: fix performance issue with C4::Members >Content-Type: text/plain; charset=utf-8 > >loading Koha::Schema ("use Koha::Schema;") takes significantly time as >it loads almost a couple hundred classes. Koha::Database has done that >already once and we can use it to get the ResultSet "Borrower" as >well, so let's use that. This also make the code more unified because >Koha::Database is used throughout the code instead of Koha::Schema. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Members.pm | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 0cd424b..9fcc733 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -46,7 +46,6 @@ use Koha::Holds; > use Koha::List::Patron; > use Koha::Patrons; > use Koha::Patron::Categories; >-use Koha::Schema; > > our (@ISA,@EXPORT,@EXPORT_OK,$debug); > >@@ -342,7 +341,7 @@ database column. > =cut > > sub get_cardnumber_length { >- my $borrower = Koha::Schema->resultset('Borrower'); >+ my $borrower = Koha::Database->new->schema->resultset('Borrower'); > my $field_size = $borrower->result_source->column_info('cardnumber')->{size}; > my ( $min, $max ) = ( 0, $field_size ); # borrowers.cardnumber is a nullable varchar(20) > $min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; >-- >2.1.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 21015
:
76556
|
80751
|
80752
| 81865 |
81866