Bug 18937 - Limit the number of entries to print for larger lists
Summary: Limit the number of entries to print for larger lists
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-13 12:32 UTC by Marcel de Rooy
Modified: 2017-12-04 13:51 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18937: Limit the number of list entries to print (3.64 KB, patch)
2017-07-13 12:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Printed list (271.22 KB, application/pdf)
2017-08-07 07:10 UTC, Marcel de Rooy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2017-07-13 12:32:41 UTC
When you have large lists of say 2000 entries, the option Print a list may be very time consuming. Especially when an impatient user hits refresh a couple of times, this might affect your server performance.
This patch adds paging to list printing when the number of list entries is over 200 (just a constant). The number of entries to print is now governed by preference OPACnumSearchResults.
Comment 1 Marcel de Rooy 2017-07-13 12:41:17 UTC
Created attachment 65020 [details] [review]
Bug 18937: Limit the number of list entries to print

When you have large lists of say 2000 entries, the option Print a list may
be very time consuming. Especially when an impatient user hits refresh a
couple of times, this might affect your server performance.

This patch adds paging to list printing when the number of list entries is
over 200 (just a constant). The number of entries to print is now governed
by preference OPACnumSearchResults.

Test plan:
[1] Pick a small list. Verify that print (add print=1 to URL) includes all
    records.
[2] Pick a large list (>200 entries). Verify that print now only includes
    records of the current page.
Comment 2 Owen Leonard 2017-08-03 16:30:21 UTC
I tried this with a list which has 281 items and it didn't seem to be working. When I printed the list I got the whole thing.

I'm not sure this is the right solution anyway... Won't this be confusing to the user? Sometimes they get the whole list and sometimes they don't?
Comment 3 Marcel de Rooy 2017-08-07 07:10:05 UTC
Created attachment 65533 [details]
Printed list

This print only contains a limited number of entries. (The list itself has more than 200 entries.)
Comment 4 Marcel de Rooy 2017-08-07 07:19:03 UTC
(In reply to Owen Leonard from comment #2)
> I tried this with a list which has 281 items and it didn't seem to be
> working. When I printed the list I got the whole thing.

Thanks for testing. This patch runs in production with us on 3.22.x without problems. I retested master and it works fine too.
Did you restart Plack?
Please check your dev environment setup. If you use kohadevbox, verify that your PERL5LIB path points to master with this patch, and not to the installed clone.

> I'm not sure this is the right solution anyway... Won't this be confusing to
> the user? Sometimes they get the whole list and sometimes they don't?

I have no other simple solution here. Slowing the server down for all other users is a good reason imo to interfere. The number of 200 is arguable and could be increased or even pref controlled (if we really want another pref). I had this issue with a list of about 1500 entries.
So, maybe we should go to 500 ?
Comment 5 Katrin Fischer 2017-10-15 08:51:14 UTC
I agree with Owen that a hard limit of 200 doesn't feel like the right solution.  I think if this is the only way, there should be a pref and also a message to the user that only a part of the list can be printed and they should be using the download options to get their complete data out.