Bugzilla – Attachment 37315 Details for
Bug 13852
Manage C4::VirtualShelves in C4::Auth for performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance
PASSED-QA-Bug-13852---Manage-C4VirtualShelves-in-C.patch (text/plain), 3.94 KB, created by
Kyle M Hall (khall)
on 2015-03-27 13:01:46 UTC
(
hide
)
Description:
[PASSED QA] Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-27 13:01:46 UTC
Size:
3.94 KB
patch
obsolete
>From f681359d82e1afa3ffb687ad1d5f74894470d9c8 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 17 Mar 2015 14:50:14 +0100 >Subject: [PATCH] [PASSED QA] Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance > >In C4::Auth there is a use C4::VirtualShelves. >Virtualshelves are displayed in all OPAC pages, but not in intranet. >For performance, we should move this into a require only for opac pages. > >This patch adds a condition to fetch virtualshelves only if opac and moves the dependancy on C4::VirtualShelves into require calls. > >On my desktop, I have those compilation times for C4/Auth.pm : >- Without patch : 0,41 seconds >- With patch : 0,22 seconds > >This performance improvement is very usefull for pages that only use a few as dependancy, like errors/404.pl > >Test plan : >- Be sure there are some public lists >- Apply patch >- Go to opac (not logged-in) >- Click on "Lists" >- Check you see the public lists >- Login with a user >- Be sure this user has some private lists >- Click on "Lists" >- Check you see the public and private lists >- Logout >- Go to /cgi-bin/koha/opac-reserve.pl >- You see the loggin page >- Click on "Lists" >- Check you see the public lists >- Go to intranet >- Check you can loggin > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Auth.pm | 32 +++++++++++++++++++------------- > 1 files changed, 19 insertions(+), 13 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 2fea732..fa4d1dc 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -30,7 +30,6 @@ use C4::Templates; # to get the template > use C4::Languages; > use C4::Branch; # GetBranches > use C4::Search::History; >-use C4::VirtualShelves; > use Koha::AuthUtils qw(hash_password); > use POSIX qw/strftime/; > use List::MoreUtils qw/ any /; >@@ -199,13 +198,16 @@ sub get_template_and_user { > $template->param( loggedinusernumber => $borrowernumber ); > $template->param( sessionID => $sessionID ); > >- my ( $total, $pubshelves, $barshelves ) = C4::VirtualShelves::GetSomeShelfNames( $borrowernumber, 'MASTHEAD' ); >- $template->param( >- pubshelves => $total->{pubtotal}, >- pubshelvesloop => $pubshelves, >- barshelves => $total->{bartotal}, >- barshelvesloop => $barshelves, >- ); >+ if ( $in->{'type'} eq 'opac' ) { >+ require C4::VirtualShelves; >+ my ( $total, $pubshelves, $barshelves ) = C4::VirtualShelves::GetSomeShelfNames( $borrowernumber, 'MASTHEAD' ); >+ $template->param( >+ pubshelves => $total->{pubtotal}, >+ pubshelvesloop => $pubshelves, >+ barshelves => $total->{bartotal}, >+ barshelvesloop => $barshelves, >+ ); >+ } > > my ($borr) = C4::Members::GetMemberDetails($borrowernumber); > my @bordat; >@@ -334,11 +336,14 @@ sub get_template_and_user { > > $template->param( sessionID => $sessionID ); > >- my ( $total, $pubshelves ) = C4::VirtualShelves::GetSomeShelfNames( undef, 'MASTHEAD' ); >- $template->param( >- pubshelves => $total->{pubtotal}, >- pubshelvesloop => $pubshelves, >- ); >+ if ( $in->{'type'} eq 'opac' ){ >+ require C4::VirtualShelves; >+ my ( $total, $pubshelves ) = C4::VirtualShelves::GetSomeShelfNames( undef, 'MASTHEAD' ); >+ $template->param( >+ pubshelves => $total->{pubtotal}, >+ pubshelvesloop => $pubshelves, >+ ); >+ } > } > > # Anonymous opac search history >@@ -1202,6 +1207,7 @@ sub checkauth { > $template->param( loginprompt => 1 ) unless $info{'nopermission'}; > > if ( $type eq 'opac' ) { >+ require C4::VirtualShelves; > my ( $total, $pubshelves ) = C4::VirtualShelves::GetSomeShelfNames( undef, 'MASTHEAD' ); > $template->param( > pubshelves => $total->{pubtotal}, >-- >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 13852
:
36950
|
37002
| 37315