Koha/C4
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
..
AuthoritiesMarc
Barcodes
ClassSortRoutine
ClassSplitRoutine
Creators Bug 32222: Fix capitalization in various "id is invalid" 2023-02-07 10:29:35 -03:00
External
Form
Heading Bug 33277: Add comments and missing thesauri 2023-05-10 15:26:23 -03:00
ILSDI 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
Installer
Labels
Linker
Members
OAI
Output
Patroncards Bug 31259: Escape infinite loop when lime cannot wrap enough 2023-03-31 13:13:39 +02:00
Reports
Search
Serials
SIP Bug 26700: Remove unused C4/SIP/t directory 2023-07-17 11:01:46 +01:00
Utils
Accounts.pm
Acquisition.pm Bug 11844: Use additional fields for order lines 2023-05-16 12:58:38 +02:00
Auth.pm Bug 33815: Do not explode if logged in user modify their own userid 2023-05-26 09:50:05 -03:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm
Auth_with_shibboleth.pm Bug 31651: Replaced duplicate error message 2023-07-17 13:43:17 +01:00
AuthoritiesMarc.pm Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing 2023-05-16 15:17:26 -03:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 31185: Link authorities automatically doesn't detect duplicate authorities 2023-07-17 13:21:43 +01:00
Breeding.pm Bug 33231: (QA follow-up) Simplify conditional for date display 2023-04-14 11:35:36 -03:00
Budgets.pm
Calendar.pm
Charset.pm
Circulation.pm Bug 32894: Koha::Item->last_returned_by 2023-07-12 07:50:40 +01:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 32478: (QA follow-up) Keep current hashref behavior 2023-06-09 16:05:07 -03:00
Contract.pm
CourseReserves.pm
Creators.pm
Heading.pm Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
HoldsQueue.pm Bug 33761: Alter query to remove items with active transfers from available list 2023-05-18 10:54:28 -03:00
HTML5Media.pm
ImportBatch.pm Bug 31618: Fix typo in POD for C4::ImportBatch::RecordsFromMARCXMLFile 2023-07-17 14:49:48 +01:00
ImportExportFramework.pm
InstallAuth.pm
Installer.pm Bug 33935: (bug 26403 follow-up) Remove occurrences to deleted files 2023-06-09 12:04:59 -03:00
ItemCirculationAlertPreference.pm
Items.pm Bug 33739: Only trigger indexing on last item modification at ModItemTransfer 2023-05-16 11:26:06 +02:00
Koha.pm Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
Labels.pm
Languages.pm Bug 32775: (QA follow-up) Fix tab and indenting issues 2023-05-15 18:23:54 -03:00
Letters.pm Bug 33360: (follow-up) Adjust wording in verbose mode 2023-04-14 11:35:34 -03:00
Linker.pm
Log.pm Bug 32057: (QA follow-up) Remove pretty flag 2023-03-14 08:49:34 -03:00
MarcModificationTemplates.pm
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-05-24 11:21:31 -03:00
Members.pm Bug 33937: Remove incorrect export in C4::Members 2023-07-12 08:07:53 +01:00
Message.pm Bug 18398: (follow-up) Update POD & Unit tests 2023-03-31 13:13:35 +02:00
Output.pm
Overdues.pm Bug 27259: Add HomeOrHoldingBranch checks where it was missing from 2022-11-04 19:04:18 -03:00
Patroncards.pm
Record.pm
Reports.pm
Reserves.pm Bug 30860: Cache CanItemBeReserved return value 2023-07-17 15:00:44 +01:00
Ris.pm Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
RotatingCollections.pm 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
Scheduler.pm
Scrubber.pm
Search.pm Bug 33725: (follow-up) Add ccode to grouping logic 2023-06-09 16:05:10 -03:00
Serials.pm Bug 33236: (follow-up) Handle new suggestion in ReNewSubscription 2023-06-09 12:04:46 -03:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm Bug 30928: Add interface to statistics 2023-05-10 14:19:22 -03:00
Suggestions.pm Bug 33236: (follow-up) Remove export of NewSuggestion 2023-06-09 12:04:47 -03:00
Tags.pm Bug 31517: (QA follow-up) Fix indentation 2022-11-04 19:30:56 -03:00
Templates.pm
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 33961: Remove built-in offline circ tool 2023-07-17 08:18:59 +01:00
XISBN.pm
XSLT.pm Bug 33567: Remove hardcoded fallback in module 2023-05-12 11:22:42 -03:00