Koha/opac
Jonathan Druart b3c5a83f46
Bug 30860: Cache CanItemBeReserved return value
This patch caches the return value of CanItemBeReserved that could
be then returned *on
demand*
We don't want to introduce side-effects hard to catch from this simple
change, so let's return the cache value only from the 2 scripts we are
dealing with.

This patch requests all item values from CanBookBeReserved on request.pl

Before this we either:
- Looped every item to find out that book could not be reserved
- Looped until we found an item that could be reserved, then looped all items to get statuses

In the worst case we avoid double processing a single item, in the best case we avoid double
processing all items (if only last on record is holdable)

To test:
1 - Find a record in staff client with several items
2 - Set AllowHoldsOnDamagedItems  to 'Dont allow'
3 - Add a damaged item to record
4 - Set a hold rule to only allow holds form homebranch and ensure record has items from other branches
5 - Setup things to prevent more items from being held
6 - Attempt hold for patron
7 - Note item statuses
8 - Apply patch
9 - Confirm statuses are as they were before

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45852c950e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:00:44 +01:00
..
clubs
errors
external/overdrive
sci
sco Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines 2023-05-12 12:40:21 -03:00
svc Bug 33697: Remove RecordedBooks (rbdigital) integration 2023-06-09 11:22:15 -03:00
ilsdi.pl
maintenance.pl
oai.pl
opac-account-pay-return.pl
opac-account-pay.pl
opac-account.pl
opac-addbybiblionumber.pl Bug 30418: Add ability for permitted staff to edit list contents 2023-05-15 18:23:57 -03:00
opac-alert-subscribe.pl
opac-article-request-cancel.pl
opac-authorities-home.pl Bug 33803: Remove comment about tab width 2023-06-09 11:22:17 -03:00
opac-authoritiesdetail.pl Bug 21330: Allow XSLT for authority detail view in OPAC 2023-05-15 18:24:03 -03:00
opac-basket.pl Bug 33102: Display fields from biblioitems in OPAC/staff interface cart 2023-05-05 17:45:19 -03:00
opac-blocked.pl
opac-browse.pl
opac-browser.pl
opac-changelanguage.pl
opac-course-details.pl
opac-course-reserves.pl
opac-curbside-pickups.pl
opac-detail.pl Bug 33037: Koha does not display difference between enumchron and serialseq in record detail view (OPAC and intranet) 2023-05-09 11:46:57 -03:00
opac-discharge.pl
opac-dismiss-message.pl Bug 12029: Remove 'params' from filter_by_unread 2023-04-20 15:48:47 -03:00
opac-downloadcart.pl
opac-downloadshelf.pl Bug 33069: Fix error in MARC download for OPAC lists 2023-05-09 10:57:55 -03:00
opac-export.pl
opac-holdshistory.pl
opac-ics.pl
opac-idref.pl
opac-illrequests.pl Bug 33702: (QA follow-up) Do not crash on borrowernumber 2023-05-29 09:21:51 -03:00
opac-image.pl
opac-imageviewer.pl
opac-ISBDdetail.pl
opac-issue-note.pl
opac-library.pl
opac-main.pl Bug 31051: Show patron savings on the OPAC 2023-02-22 10:03:33 -03:00
opac-MARCdetail.pl Bug 23247: Use EmbedItems in opac-MARCdetail.pl 2023-02-20 09:44:15 -03:00
opac-memberentry.pl Bug 33197: Rename GDPR_Policy system preference 2023-05-05 10:18:54 -03:00
opac-messaging.pl
opac-modrequest-suspend.pl
opac-modrequest.pl
opac-mymessages.pl
opac-news-rss.pl
opac-overdrive-search.pl
opac-page.pl
opac-passwd.pl
opac-password-recovery.pl
opac-patron-consent.pl Bug 33197: Rename GDPR_Policy system preference 2023-05-05 10:18:54 -03:00
opac-patron-image.pl
opac-privacy.pl
opac-ratings.pl
opac-readingrecord.pl Bug 33951: (QA follow-up) Import GetNormalizedOCLCNumber 2023-07-12 07:58:01 +01:00
opac-recall.pl
opac-recalls.pl
opac-registration-verify.pl Bug 33192: Update all occurrences of AutoEmailPrimaryAddress 2023-04-14 11:35:39 -03:00
opac-renew.pl Bug 31735: Optimize OPAC checkouts view 2023-05-12 12:40:29 -03:00
opac-reportproblem.pl
opac-request-article.pl
opac-reserve.pl Bug 30860: Cache CanItemBeReserved return value 2023-07-17 15:00:44 +01:00
opac-reset-password.pl
opac-restrictedpage.pl
opac-retrieve-file.pl
opac-review.pl
opac-routing-lists.pl
opac-search-history.pl
opac-search.pl Bug 33569: Fix sort by relevance in catalog search 2023-05-09 11:46:47 -03:00
opac-sendbasket.pl Bug 33223: Replace 'first_valid' with 'notice' for email addresses 2023-05-16 15:17:35 -03:00
opac-sendshelf.pl Bug 33223: Fix sendshelf 2023-05-16 15:17:36 -03:00
opac-serial-issues.pl
opac-shareshelf.pl
opac-shelves.pl Bug 30418: Add ability for permitted staff to edit list contents 2023-05-15 18:23:57 -03:00
opac-showmarc.pl
opac-showreviews.pl
opac-suggestions.pl Bug 33236: Move NewSuggestion to Koha::Suggestion->store 2023-06-09 12:04:46 -03:00
opac-tags.pl
opac-tags_subject.pl
opac-topissues.pl
opac-user.pl Bug 33957: Add normalized_oclc and only fetch when needed 2023-07-12 09:18:21 +01:00
tracklinks.pl
unapi