Koha/opac
Nick Clemens fccf143330 Bug 29685: Reduce item processing by calculating 'items any available' outside of loop
See bug 24185, this avoids looping every each item of the record for every item of the record

How to reproduce:

1) on freshly installed kohadevbox create/import one book,
remember that biblionumber for later use it in down below,

2) add 100 items for that book for some library,

3) find some patron, that patron's card number we will
use as a borrower down below to open holds page,

4) check for the rule or set up a single circulation rule
in admin "/cgi-bin/koha/admin/smart-rules.pl",
that rule should match above book items/library/patron,
check that rule to have a non-zero number of holds (total, daily, count) allowed,
and, IMPORTANT: set up "On shelf holds allowed" to "If all unavailable",
("item level holds" doesn't matter).

5) open "Home > Catalog > THAT_BOOK > Place a hold on THAT_BOOK" page
("holds" tab), and enter patron code in the search field,
or you can create a direct link by yourself, for example, in my case it was:
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=23529000686353

6) it should be pretty long page generation time on old code, densely increasing for every hundred items added. In the case of this solution, it's fast, and time increases a little only, linear.

In testing with 100 books I went from ~6.5 seconds to ~3.2 seconds

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-12 21:26:26 -10:00
..
clubs Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
errors Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
external/overdrive Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
sci Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
sco Bug 28211: Replace use of call_recursive() with call() 2021-10-18 11:28:41 +02:00
svc Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
ilsdi.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
maintenance.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
oai.pl
opac-account-pay-return.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-account-pay.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-account.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-addbybiblionumber.pl Bug 28959: (follow-up) Adjust all places in which 'category' was used 2021-10-28 17:47:38 +02:00
opac-alert-subscribe.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-article-request-cancel.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-authorities-home.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-authoritiesdetail.pl Bug 29435: include missing subroutine from C4::AuthoritiesMarc 2021-11-15 12:38:39 +01:00
opac-basket.pl Bug 27266: (QA follow-up) Remove GetBiblioData from basket scripts 2021-12-15 12:15:14 -10:00
opac-blocked.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-browse.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-browser.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-changelanguage.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
opac-course-details.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-course-reserves.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-detail.pl Bug 27266: (follow-up) Remove get_marc_authors from opac-detail 2021-12-15 12:15:12 -10:00
opac-discharge.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-downloadcart.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-downloadshelf.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-export.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-holdshistory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-ics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-idref.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-illrequests.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-image.pl Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
opac-imageviewer.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-ISBDdetail.pl Bug 29180: Rename syspref RequestOnOpac with OPACHoldRequests 2021-11-05 12:13:25 +01:00
opac-issue-note.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-library.pl Bug 27360: Prevent crash if branchcode does not exist 2021-11-03 15:40:52 +01:00
opac-main.pl Bug 24387: Rename "News" with "Additional contents" 2021-08-16 11:55:55 +02:00
opac-MARCdetail.pl Bug 29180: Rename syspref RequestOnOpac with OPACHoldRequests 2021-11-05 12:13:25 +01:00
opac-memberentry.pl Bug 13188: Add PatronSelfModificationMandatoryField system preference 2021-12-14 09:46:22 -10:00
opac-messaging.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-modrequest-suspend.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-modrequest.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-mymessages.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-news-rss.pl Bug 24387: Rename "News" with "Additional contents" 2021-08-16 11:55:55 +02:00
opac-overdrive-search.pl Bug 29318: Tidy the code 2021-10-26 16:46:03 +02:00
opac-passwd.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-password-recovery.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-patron-consent.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-patron-image.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
opac-privacy.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-ratings-ajax.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
opac-ratings.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-readingrecord.pl Bug 28768: (QA follow-up) Remove unused variable 2021-11-05 12:17:08 +01:00
opac-recordedbooks-search.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-registration-verify.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-renew.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-reportproblem.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-request-article.pl Bug 29093: Interface changes 2021-10-15 11:34:26 +02:00
opac-reserve.pl Bug 29685: Reduce item processing by calculating 'items any available' outside of loop 2022-01-12 21:26:26 -10:00
opac-restrictedpage.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-retrieve-file.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-review.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-routing-lists.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-search-history.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-search.pl Bug 5229: Remove system preference 'OPACItemsResultsDisplay' 2021-11-19 15:23:27 +01:00
opac-sendbasket.pl Bug 27266: (QA follow-up) Remove GetBiblioData from basket scripts 2021-12-15 12:15:14 -10:00
opac-sendshelf.pl Bug 27266: (QA follow-up) Remove GetBiblioData from sendshelf too 2021-12-15 12:16:10 -10:00
opac-serial-issues.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-shareshelf.pl Bug 28959: Fix other cases 2021-10-28 17:47:38 +02:00
opac-shelves.pl Bug 28959: Add virtualshelves.public as a boolean 2021-10-28 17:47:38 +02:00
opac-showmarc.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-showreviews.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-suggestions.pl Bug 26296: Use new table column selection modal for OPAC suggestion fields 2022-01-09 21:04:17 -10:00
opac-tags.pl Bug 29669: fix uninitialized value warnings when XSLTParse4Display is called 2021-12-16 12:13:51 -10:00
opac-tags_subject.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-topissues.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-user.pl Bug 28417: Don't require C4::Auth_with_cas from opac-user if not needed 2021-11-03 15:40:52 +01:00
tracklinks.pl Bug 22690: Fix the tracklink feature 2021-08-31 08:23:05 +02:00
unapi Bug 17600: Fix opac/unapi 2021-11-22 11:04:51 +01:00