Koha/C4
Tomas Cohen Arazi d4468c5f33
Bug 11677: Use zebra not-onloan-count index for availability limit
This uses the work from bug 18098 to use the count of not-onloan items to
determine availability.

It keeps the allrecords,AlwaysMatches='' portion of the query so it still catches
records with the tested indexed missing.
These shouldn't exist except in the case of missing data, but kept for future use as well as
it has no negative impact and minimizes the change made.

Note that availability in this sense means not check out and not lost. Transfers, holds, and not for loan statuses
should probably have indexes built in the same way as bug 18098 (there are related FIXMEs in the code)

This updates the export_records file used for testing - adding three records with a not-onloan-count (999$x) of 1,
but marking the item on the third record lost to prevent its return

To test:
   1 - make sure SearchEngine pref is set to 'Zebra'
   2 - Do a search on the OPAC that returns some records
   3 - Find a record in those results with more than one 1 item, and checkout 1 leaving 1 (or more) available
   4 - Find another record with only 1 item, check that item out
   5 - Limit opac search to available items - both records disappear
   6 - Apply patch
   7 - Restart all the things
   8 - Repeat search
   9 - First record should show, but no second
  10 - Mark other items of first record as lost, return items on second record
  11 - Repeat search, first record should not be in results, second should
  12 - prove -v t/db_dependent/Search.t

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-20 15:00:16 +01:00
..
AuthoritiesMarc
Barcodes Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode 2019-04-19 14:32:36 +00:00
ClassSortRoutine
ClassSplitRoutine
Creators Bug 22878: Do not pass layout_id on creating a layout 2019-05-15 12:10:52 +00:00
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Form
Heading Bug 21826: (QA follow-up) Add UNIMARC support 2019-01-25 20:13:39 +00:00
ILSDI Bug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service 2019-06-25 17:16:26 +01:00
Installer Bug 21073: (follow-up) Add Class::Inspector to PerlDependencies 2019-06-18 17:30:14 +01:00
Labels Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Linker Bug 21450: Cache authorities search using term and auth_type 2019-05-30 10:13:38 +00:00
Members
OAI
Output
Patroncards Bug 22429: Infinite loop in patron card printing 2019-03-15 11:59:28 +00:00
Reports Bug 22357: Do not duplicate report rows if several reports exist 2019-04-30 11:35:23 +00:00
Search
Serials
SIP Bug 20954: (QA follow-up) Rename syspref-overrides to syspref_overrides to maintain existing convention 2019-08-13 11:48:12 +01:00
Utils Bug 20514: Use streetnumber when searching for patrons by address 2019-05-15 12:10:53 +00:00
Accounts.pm Bug 22563: Typo in query (manualinvoice) 2019-07-15 11:28:03 +01:00
Acquisition.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Auth.pm Bug 23253: Fix OpacNavRight for self reg by email 2019-08-15 09:19:28 +01:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm Bug 22461: (follow-up) Use exists not defined 2019-04-26 17:51:09 +00:00
Auth_with_shibboleth.pm
AuthoritiesMarc.pm Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm 2019-05-07 11:39:24 +00:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 11529: (follow-up) Fix QA issues 2019-08-05 15:03:19 +01:00
Bookseller.pm
Boolean.pm
Breeding.pm Bug 22532: Remove Z39.50 random 2019-04-18 10:48:10 +00:00
Budgets.pm Bug 10577: (QA follow-up) Remove tab chars 2019-03-28 12:46:14 +00:00
Calendar.pm
Charset.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Circulation.pm Bug 11573: Make rental accountlines translatable 2019-07-26 16:11:20 +01:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 22600: Add 'cron' to interface types and set appropriately 2019-04-10 19:43:11 +00:00
Contract.pm
CourseReserves.pm Bug 22142: Do not revert data if 'unchanged' was set 2019-08-13 11:22:13 +01:00
Creators.pm
Debug.pm
Heading.pm Bug 21826: Remove strict and warning from Heading.pm 2019-01-25 20:13:41 +00:00
HoldsQueue.pm Bug 11529: (RM follow-up) Fix missing comma in query 2019-08-05 17:25:08 +01:00
HTML5Media.pm
Images.pm Bug 21987: Do not generate true color thumbnails if not needed 2019-03-15 12:19:56 +00:00
ImportBatch.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
ImportExportFramework.pm Bug 18143: Silence ods MARC framework export flood 2019-02-19 13:52:15 +00:00
InstallAuth.pm
Installer.pm Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm 2019-08-05 11:34:59 +01:00
ItemCirculationAlertPreference.pm
Items.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Koha.pm Bug 23324: (QA follow-up) Typo and remove unneeded use statement 2019-08-16 12:27:01 +01:00
Labels.pm
Languages.pm Bug 18213: Add Template plugin and fix for C4/Languages 2019-03-28 15:57:32 +00:00
Letters.pm Bug 5770: (QA follow-up) Revert change to GetQueuedMessages 2019-05-10 17:29:31 +00:00
Linker.pm
Log.pm Bug 22600: Add 'interface' to accountlines 2019-04-10 19:43:11 +00:00
MarcModificationTemplates.pm Bug 21831: Allow move all fields even if destination field is different 2019-05-23 14:50:57 +00:00
Matcher.pm Bug 23324: Add an ISBN normalization routine 2019-08-16 12:26:48 +01:00
Members.pm Bug 19920: Removed unnecessary code from C4/Members.pm 2019-01-25 16:11:48 +00:00
Message.pm Bug 21206: Replace C4::Items::GetItem 2019-02-26 13:24:07 +00:00
NewsChannels.pm
Output.pm Bug 23117: Shortcut additem.pl on nonexistent biblionumber 2019-06-15 08:01:37 +01:00
Overdues.pm Bug 11529: Use new biblio fields whenever possible 2019-08-05 15:03:17 +01:00
Patroncards.pm
Print.pm
Record.pm
Reports.pm
Reserves.pm Bug 22610: Update SIP2 to use payment_type 2019-08-05 15:02:54 +01:00
Ris.pm
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 11677: Use zebra not-onloan-count index for availability limit 2019-08-20 15:00:16 +01:00
Serials.pm Bug 23416: Add PreserveSerialNotes system preference 2019-08-12 14:35:18 +01:00
Service.pm
ShelfBrowser.pm Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
SMS.pm
SocialData.pm
Stats.pm Bug 21683: Remove accountlines.accountno 2019-03-21 18:19:22 +00:00
Suggestions.pm Bug 22907: Add missing use statement 2019-05-30 10:19:06 +00:00
Tags.pm
Templates.pm
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 14576: Allow arbitrary automatic update of location on checkin 2019-04-25 11:36:23 +00:00
XISBN.pm Bug 12537: Don't retrieve XISBN results for the same biblionumber 2019-07-15 11:27:59 +01:00
XSLT.pm Bug 22899: (QA follow-up) Change accessor name 2019-05-14 18:08:34 +00:00