Bugzilla – Attachment 38476 Details for
Bug 13022
Hardcoded limit causes records with more than 20 items to show inaccurate statuses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13022 - Hardcoded limit causes records with more than 20 items to show inaccurate statuses
Bug-13022---Hardcoded-limit-causes-records-with-mo.patch (text/plain), 4.60 KB, created by
Jonathan Druart
on 2015-04-24 08:32:29 UTC
(
hide
)
Description:
Bug 13022 - Hardcoded limit causes records with more than 20 items to show inaccurate statuses
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-24 08:32:29 UTC
Size:
4.60 KB
patch
obsolete
>From 4b07efc12c13b1ff123460baa0cda53a71538374 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 2 Oct 2014 09:19:21 -0400 >Subject: [PATCH] Bug 13022 - Hardcoded limit causes records with more than 20 > items to show inaccurate statuses >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >If a record has more than 20 items, all the items over 20 will show as >available on the search results even if they are not! > >This is a hard coded limit in the Search module. This number should be >configurable. > >Test Plan: >1) Create a record with more than 20 items >2) Set all the items to waiting holds or in transit >3) Search for results that will include that item >4) Note some say they are available even though they are not >5) Apply this patch >6) Run updatedatabase.pl >7) Set the new system preference MaxSearchResultsItemsPerRecordStatusCheck > to a number larger than the number of items on your record >8) Re-run the search >9) Note that the hold and transit statuses for the items are now correct > >Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Search.pm | 2 +- > installer/data/mysql/atomicupdate/bug_13022.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences/searching.pref | 5 +++++ > 4 files changed, 8 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_13022.sql > >diff --git a/C4/Search.pm b/C4/Search.pm >index 8d110c1..d5da943 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2139,7 +2139,7 @@ sub searchResults { > || $item->{itemlost} > || $item->{damaged} > || $item->{notforloan} >- || $items_count > 20) { >+ || $items_count > C4::Context->preference('MaxSearchResultsItemsPerRecordStatusCheck') ) { > > # A couple heuristics to limit how many times > # we query the database for item transfer information, sacrificing >diff --git a/installer/data/mysql/atomicupdate/bug_13022.sql b/installer/data/mysql/atomicupdate/bug_13022.sql >new file mode 100644 >index 0000000..88d5a13 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_13022.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('MaxSearchResultsItemsPerRecordStatusCheck','20','Max number of items per record for which to check transit and hold status','','Integer'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index be44611..e3e35c8 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -204,6 +204,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'), > ('maxRecordsForFacets','20',NULL,NULL,'Integer'), > ('maxreserves','50','','Define maximum number of holds a patron can place','Integer'), >+('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'), > ('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'), > ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), > ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 8b04d39..a7c39bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -149,6 +149,11 @@ Searching: > class: integer > - results per page in the staff client. > - >+ - For records with many items, only check the availability status for the first >+ - pref: MaxSearchResultsItemsPerRecordStatusCheck >+ class: integer >+ - items. If a record has more than this number of items, they availability statuses may be incorrect in the search results, but will be correct in the record details. >+ - > - By default, sort search results in the OPAC by > - pref: OPACdefaultSortField > default: relevance >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13022
:
31978
|
37970
|
37971
|
38066
|
38069
|
38072
|
38075
|
38076
|
38437
|
38438
|
38476
|
38477
|
38478
|
45957
|
45958
|
45959