Bug 4841 - Advanced search returns 0 results if the itemtype have no items
Summary: Advanced search returns 0 results if the itemtype have no items
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Larry Baerveldt
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 01:53 UTC by Alejandro Tiraboschi
Modified: 2013-12-05 20:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
0001-Bug-4841 (1.20 KB, patch)
2011-09-22 20:49 UTC, Larry Baerveldt
Details | Diff | Splinter Review
Signed off Patch (1.26 KB, patch)
2011-09-26 12:01 UTC, Ian Walls
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro Tiraboschi 2010-06-01 01:53:38 UTC
When you specify the item type of that you’re searching, advanced search seeks on the subfield 952$y. So, if you do not have items, the search returns 0 results.  

You can modify two templates in such a way that the criteria of search were the subfield 942$c:

/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl
/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/modules/opac-advsearch.tmpl

In these files you should change     mc-<!-- TMPL_VAR NAME="ccl" -->       with       itemtype
Comment 1 dev_patches 2010-08-27 08:21:39 UTC
Is this a bug ? 
Your solution looks strange.
I would have edited record.abs to make the index point on a biblio field... (assuming it is a local need)
Comment 2 Larry Baerveldt 2011-09-22 20:49:24 UTC Comment hidden (obsolete)
Comment 3 Larry Baerveldt 2011-09-22 20:53:46 UTC
Patch attached.
Comment 4 Ian Walls 2011-09-26 12:01:38 UTC
Created attachment 5586 [details] [review]
Signed off Patch

This patch simply adds 942$c to the itype index as well as the itemtype index.  This allows the biblio-level itemtype to serve as a fall-back value for biblios without any attached items (in an item-level_itypes set up, which is more common).  In particular, this is useful for E-books and Serials, which may not have attached items, but could have their own item types in the OPAC.
Comment 5 Ian Walls 2011-09-26 12:04:51 UTC
If anyone feels uncomfortable about my doing both the signoff and the QA work on this patch, or the fact that the author is also with ByWater Solutions, please speak up.

Adds data from a specific MARC field to an additional index; no issues with regression.  Running successfully on a production library catalog.  Marking as Passed QA.
Comment 6 Chris Cormack 2011-09-26 20:49:10 UTC
Seems to work fine, pushed
Comment 7 Jared Camins-Esakov 2012-12-31 00:21:17 UTC
There have been no further reports of problems so I am marking this bug resolved.