Bugzilla – Attachment 21898 Details for
Bug 11009
Do not allow reading records of anonymous patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11009 - Add hardcoded limit to OPAC reading records
0002-Bug-11009-Add-hardcoded-limit-to-OPAC-reading-record.patch (text/plain), 3.33 KB, created by
Fridolin Somers
on 2013-10-09 12:21:03 UTC
(
hide
)
Description:
Bug 11009 - Add hardcoded limit to OPAC reading records
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-10-09 12:21:03 UTC
Size:
3.33 KB
patch
obsolete
>From 5d1b4ff87568b64a8ee4471903efd4da0bfdded6 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 8 Oct 2013 16:46:55 +0200 >Subject: [PATCH 2/2] Bug 11009 - Add hardcoded limit to OPAC reading records > >Each reading record will fetch from database all columns of biblio, biblioitems (including marcxml), items and issues or old_issues. >So if there are a great number of reading records, the page may create a heavy load on server. >Considering it is at OPAC, this may be used to overload the server. > >This patch adds an hardcoded limit on OPAC reading records : 500. > >Test plan : >- Connect on OPAC with a borrower having less than 500 reading records >- Go to "my reading hystory" : opac-readingrecord.pl >=> Tab "Showing last 50 items" is selected and you see 50 records >- Click on "Show all items" tab >=> You see all records >- Connect on OPAC with a borrower having more than 500 reading records >- Go to "my reading hystory" : opac-readingrecord.pl >=> Tab "Showing last 50 items" is selected and you see 50 records >- Click on "Show all items" tab >=> You see 500 records >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt | 4 ++-- > opac/opac-readingrecord.pl | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt >index 7ee7e12..ab9bb53 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt >@@ -32,7 +32,7 @@ You have never borrowed anything from this library. > <div id="opac-user-readingrec" class="statictabs"> > > <div class="resultscontrol resort"> <form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get"> >-[% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %] >+[% IF ( limit == 'full' ) %]<input type="hidden" name="limit" value="full" />[% END %] > <select name="order" id="order"> > > [% IF ( orderbydate ) %]<option value="" selected="selected">Order by date</option>[% ELSE %]<option value="">Order by date</option>[% END %] >@@ -44,7 +44,7 @@ You have never borrowed anything from this library. > <ul> > > [% IF ( showfulllink ) %] >-[% IF ( limit ) %] >+[% UNLESS ( limit == 'full' ) %] > <li><a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&order=title[% END %]">Show all items</a></li><li class="active"><a href="#readingrec">Showing last 50 items</a></li> > [% ELSE %] > <li class="active"><a href="/cgi-bin/koha/opac-readingrecord.pl#readingrec">Showing all items</a></li><li><a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&order=title[% END %]">Show last 50 items only</a></li> >diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl >index 4f16c66..434ca87 100755 >--- a/opac/opac-readingrecord.pl >+++ b/opac/opac-readingrecord.pl >@@ -66,9 +66,9 @@ else { > > > my $limit = $query->param('limit'); >-$limit = ( $limit eq 'full' ) ? 0 : 50; >+my $limitsql = ( $limit eq 'full' ) ? 500 : 50; # hardcoded limit to avoid server heavy load > >-my $issues = GetAllIssues( $borrowernumber, $order, $limit ); >+my $issues = GetAllIssues( $borrowernumber, $order, $limitsql ); > > my $itype_attribute = > ( C4::Context->preference('item-level_itypes') ) ? 'itype' : 'itemtype'; >-- >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 11009
:
21896
|
21898
|
22931
|
22977