Koha/C4
Kyle M Hall fcaa6f35c0 Bug 13636 - Staff search results item status incorrect for holds
Imagine this scenario: we have one record with four items. Two of those
items are checked out, one of those items is a waiting hold, and one of
those items is available. We would expect to see this on the search
results page. Instead, we will see both non-checked out items as
unavailable due to waiting holds.

This is due to a semantic issue GetReserveStatus.
C4::Search::searchResults uses GetReserveStatus to get the reserve
status of each item, but unlike all other calls to the sub, this one
passes in not only itemnumber, but biblionumber.

When no reserve is found for the available item, the subroutine uses the
biblionumber to grab what is essentially an arbitrary reserve to use for
the status. This makes no sense and this functionality should be
entirely removed from the subroutine so regressions like this will be
prevented in the future.

Test Plan:
1) Create one record with 4 items
   a) check two of the items out to patrons
   b) set one of the items as a waiting hold
   c) leave the fourth item as available
2) Run a search where this record will be in the results list
3) Note that the results list 2 items on loan, two unavailable
4) Apply this patch, reload the search results
5) Note that the results list 1 available, 2 on loan, 1 unavailable

Signed-off-by: John Andrews <jandrews@washoecounty.us>
Signed-off-by: Sheila Kearns <sheila.kearns@state.vt.us>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Note: This is for the staff search result list!

Works as expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-11 10:20:35 -03:00
..
AuthoritiesMarc Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Barcodes Bug 11539: removing 2 unused files 2014-01-14 20:55:28 +00:00
Bookseller Bug 10402 follow-up: choose contacts for claims 2014-08-26 11:45:59 -03:00
ClassSortRoutine Bug 8837: Dewey cn_sort inaccurate 2014-10-28 09:39:29 -03:00
Creators Bug 13407: Removing depricated code included in PDF::Reuse 2015-01-07 20:18:53 -03:00
External Bug 12041 - improve Koha::Cache 2014-06-19 13:05:04 -03:00
Form Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Heading Bug 10308 - local subjects can use authorities too 2014-09-01 10:45:07 -03:00
ILSDI Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Installer Bug 13407: Bumping required version of PDF::Reuse 2015-01-07 20:19:38 -03:00
Labels Bug 13124 - Record titles with parentheses causing label weirdness 2014-12-28 20:01:42 -03:00
Linker Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl 2014-07-07 12:40:25 -03:00
Members Bug 13194: Fix typo in SetMessagingPreferencesFromDefaults POD 2014-11-06 10:14:13 -03:00
OAI Bug 9295: Introduce operator equal/ notequal to OAI set mapping instead of hardcoded 'equal' value. 2013-10-10 23:03:30 +00:00
Output Fix FSF address in directory C4/ 2010-03-16 20:17:56 -04:00
Patroncards Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Reports Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Search Bug 11944: Fix encoding issue on search history 2015-01-13 13:07:28 -03:00
Serials Bug 7688: (follow-up) update license statements 2013-10-30 02:56:32 +00:00
SIP Bug 7904 Change SIP modules to use standard LIB path 2015-02-05 14:44:54 -03:00
Utils Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
VirtualShelves Bug 13418: Clean C4::VirtualShelves::Page - Part 2 2015-02-09 10:20:51 -03:00
Accounts.pm Bug 12865 - 'Pay amount toward all fines' does not record payment note 2014-11-25 16:38:46 -03:00
Acquisition.pm Bug 13675: Do not set aqorders.budget_id to NULL 2015-02-10 08:45:44 -03:00
Auth.pm Bug 10900 - Incorrect calling conventions accessing C4::Context 2015-02-09 17:00:13 -03:00
Auth_cas_servers.yaml.orig Bug 5630 CAS improvements 2011-10-13 10:49:49 +13:00
Auth_with_cas.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Auth_with_ldap.pm Bug 9165: (Followup) Tidied code slightly 2014-11-27 14:58:46 -03:00
Auth_with_shibboleth.pm BUG8446, QA Followup: Use DBIx::Class 2014-10-16 12:28:01 -03:00
AuthoritiesMarc.pm Bug 12861: (follow-up) Noisy warn in error logs 2015-01-21 10:47:47 -03:00
BackgroundJob.pm Bug 10601: (follow-up) improvements to ->set() and ->get() 2013-09-18 17:23:44 +00:00
Barcodes.pm Bug 6679 - [SIGNED-OFF] fix 8 perlcritic violations in C4/Barcodes.pm 2012-09-20 12:01:36 +02:00
Biblio.pm Bug 11944: FIX Error on editing an authority 2015-01-13 13:07:11 -03:00
Bookseller.pm Bug 12896: Move the bookseller-related code into Koha::Acquisition::Bookseller 2014-12-31 14:15:58 -03:00
Boolean.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Branch.pm Bug 9350: Making changes so that you can add the new fields to branches 2014-10-27 10:38:16 -03:00
Breeding.pm Bug 11961 - Add a "Z39.50 search" button to the authority creation and modification pages. 2015-01-24 18:19:06 -03:00
Budgets.pm Bug 11714 - GetBudgetHierarchy needs optimization 2014-10-31 16:41:46 -03:00
Calendar.pm Bug 7351 : feature that allows to delete a range of dates 2012-09-28 12:19:45 +02:00
Category.pm Bug 7919: FIX the "all" categories method 2013-01-02 16:50:52 -05:00
Charset.pm Bug 11944: revert unneeded IsStringUTF8ish behaviour change 2015-01-13 13:07:52 -03:00
Circulation.pm Bug 10606: Remove MySQLism in GetUpcomingDueIssues 2015-01-21 11:06:24 -03:00
ClassSortRoutine.pm Bug 12424 - ddc sorting of call numbers truncates long Cutter parts 2014-10-18 10:50:07 -03:00
ClassSource.pm Bug 10643: fix inappropriate uses of $sth->finish() in C4::ClassSource.pm 2013-08-09 15:32:22 +00:00
Context.pm Bug 10900 - Incorrect calling conventions accessing C4::Context 2015-02-09 17:00:13 -03:00
Contract.pm Bug 12487 [QA Followup] - GetContract must return undef with no params 2014-07-30 10:44:45 -03:00
CourseReserves.pm bug 8215: (followup) rename GetItemReservesInfo 2013-05-21 15:51:03 -07:00
Creators.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Csv.pm Bug 10853: All existing routing to get a CSV should return a MARC csv 2013-10-11 02:16:33 +00:00
Dates.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Debug.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Heading.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
HoldsQueue.pm Bug 11258: fix another case where holds queue made transfer requests that contradict the library holds policy 2014-04-18 15:23:23 +00:00
HTML5Media.pm Bug 8377: Followup move style in a css file and do not pass template to a pm 2012-12-27 09:28:00 -05:00
Images.pm Bug 8710 - Don't show the images tab in the OPAC if the record has no local images 2012-11-28 18:54:40 -05:00
ImportBatch.pm Bug 13222 - Accessors for import_record.status have variable names suggesting overlay_status 2015-01-14 21:27:49 -03:00
ImportExportFramework.pm Bug 11666: remove SQL as an option for MARC framework exports and imports 2014-02-05 19:48:27 +00:00
Input.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
InstallAuth.pm Bug 10900 - Incorrect calling conventions accessing C4::Context 2015-02-09 17:00:13 -03:00
Installer.pm Bug 11944: replace use of utf8 with Encode 2015-01-13 13:06:45 -03:00
ItemCirculationAlertPreference.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/ItemCirculationAlertPreference.pm 2012-09-20 12:01:39 +02:00
Items.pm Bug 13562: Fix item search on item MARC subfields 2015-02-09 10:28:09 -03:00
ItemType.pm Bug 11944: Fix encoding issue in C4::ItemType 2015-01-13 13:07:33 -03:00
Koha.pm Bug 13167 Stage MARC for Import hangs for biblio containing invalid ISBN-13 2015-01-04 11:15:24 -03:00
Labels.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Languages.pm Bug 12534 - PROG/CCSR deprecation: Make getlanguages() theme independent for opac 2014-07-14 09:01:08 -03:00
Letters.pm Bug 13215: Fix GetLetterTemplates should return default templates if branchcode is not defined 2014-11-27 11:42:26 -03:00
Linker.pm Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl 2014-07-07 12:40:25 -03:00
Log.pm Bug 11331 - CSV export for viewlog.pl is missing newlines 2014-08-05 20:23:26 -03:00
MarcModificationTemplates.pm Bug 11413: Fix field_numbers 2014-11-14 12:05:47 -03:00
Matcher.pm Bug 10500: (follow-up) disable AggressiveMatchOnISBN if UseQueryParser is on 2014-05-05 19:31:00 +00:00
Members.pm Bug 12889: Updated pod for C4::Members::AddMember 2015-01-14 21:43:37 -03:00
Message.pm Bug 13504: Remove the '----' marker for CHECKIN and CHECKOUT notices 2015-01-04 11:20:10 -03:00
NewsChannels.pm Bug 12507 - News does not always display in staff or OPAC 2014-08-24 12:37:06 -03:00
Output.pm Bug 12845: C4::Output::FormatData can be removed 2015-01-17 10:26:21 -03:00
Overdues.pm Bug 11872 - Lost overdue items should not generate fines 2015-01-07 20:15:55 -03:00
Patroncards.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Print.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/Print.pm 2012-09-20 12:17:43 +02:00
Ratings.pm Bug 12609: Add some unit tests for C4::Ratings 2014-09-17 22:08:57 -03:00
Record.pm Bug 13190: Reintroduce the checkouts export feature 2014-11-06 10:00:30 -03:00
Reports.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
Reserves.pm Bug 13636 - Staff search results item status incorrect for holds 2015-02-11 10:20:35 -03:00
Review.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Ris.pm Bug 13360: C4::Ris assumes that hash keys are ordered - KW 2014-12-28 19:56:31 -03:00
RotatingCollections.pm Bug 8836 [QA Followup] - Prevent multiple collections from having the same title 2014-11-06 15:12:20 -03:00
Scheduler.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Scrubber.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Search.pm Bug 13636 - Staff search results item status incorrect for holds 2015-02-11 10:20:35 -03:00
Serials.pm Bug 12850: C4::Serials::GetLateIssues can be removed 2015-01-14 21:32:03 -03:00
Service.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
ShelfBrowser.pm Bug 10856: (follow-up) if callnumbers are equal, order should be on itemnumber 2013-10-04 15:57:03 +00:00
SMS.pm Bug 3186 [QA Followup] - Don't return undef, just return 2014-10-30 01:23:12 -03:00
SocialData.pm bug 7470 follow-up, fix POD doc 2012-03-26 17:53:28 +02:00
SQLHelper.pm Bug 11425: Get column names using DBIX 2014-11-04 19:10:28 -03:00
Stats.pm Bug 10860 - Change "in-house use" to "on-site checkout" 2014-11-03 10:26:22 -03:00
Suggestions.pm Bug 13007: Special case budgetid == '' 2015-02-09 15:49:57 -03:00
Tags.pm Bug 12916 - Use of uninitialized values $max and $min in C4/Tags.pm 2014-10-30 00:31:36 -03:00
Templates.pm Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
TmplToken.pm Bug 12131: Remove unused dependency on Exporter 2014-04-25 15:24:39 +00:00
TmplTokenType.pm Revert "Bug 6679 - [SIGNED-OFF] fix 9 perlcritic violations in C4/TmplTokenType.pm" 2012-09-20 13:29:59 +02:00
TTParser.pm Bug 12207: fix TTparser's handling of TT directives that contain "]" 2014-05-23 15:23:20 +00:00
UploadedFile.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
UsageStats.pm Bug 11926: Follow-up - remove SearchEngine pref / fix POD 2014-10-22 15:17:14 -03:00
VirtualShelves.pm Bug 13418: [QA Follow-up] Use unshift instead of push 2015-02-09 10:20:47 -03:00
XISBN.pm Bug 11096: support the retrieval of large MARCXML records 2014-02-28 19:50:09 +00:00
XSLT.pm Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT 2014-10-30 09:35:12 +13:00