Bug 19807 - IntranetCatalogSearchPulldown doesn't honor IntranetNumbersPreferPhrase
Summary: IntranetCatalogSearchPulldown doesn't honor IntranetNumbersPreferPhrase
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Victor Grousset/tuxayo
QA Contact: Testopia
URL:
Whiteboard:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2017-12-13 19:35 UTC by Victor Grousset/tuxayo
Modified: 2018-06-04 20:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase (3.09 KB, patch)
2017-12-13 19:55 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase (3.14 KB, patch)
2017-12-27 20:19 UTC, Jon Knight
Details | Diff | Splinter Review
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase (3.19 KB, patch)
2017-12-29 06:45 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2017-12-13 19:35:51 UTC
With IntranetCatalogSearchPulldown and IntranetNumbersPreferPhrase enabled.

Doing a search in the intranet from the search pulldown for the call number searches "callnum,wrdl: foobar".

But it should search "callnum,phr: foobar"

=== Going further ===

It's very likely to also affect the OPAC
Comment 1 Victor Grousset/tuxayo 2017-12-13 19:55:43 UTC
Created attachment 69782 [details] [review]
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase

This patch
- fixes callnum and sn
- Removes unecessary syspref transmission to the template.
  As the template directly reads the syspref

Test plan:
1. Set sysprefs IntranetCatalogSearchPulldown and
   IntranetNumbersPreferPhrase to true
2. Go to staff:/cgi-bin/koha/catalogue/search.pl
3. "search for" → "call number" and write anything that won't match a
   call number in the field
4. Then you should see
   «No results match your search for 'callnum,phr: [...]»
5. Go to the staff homepage
6. Click on "Search the catalog"
7. Do the same search as previouly
8. Then you should see
   «No results match your search for 'callnum,wrdl: [...]»
   This shows that IntranetNumbersPreferPhrase isn't honored
9. Apply this patch
10. Redo the same two searches and see that phr will now be always used.
    So IntranetNumbersPreferPhrase is honored
Comment 2 Jon Knight 2017-12-27 20:19:47 UTC
Created attachment 70180 [details] [review]
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase

This patch
- fixes callnum and sn
- Removes unecessary syspref transmission to the template.
  As the template directly reads the syspref

Test plan:
1. Set sysprefs IntranetCatalogSearchPulldown and
   IntranetNumbersPreferPhrase to true
2. Go to staff:/cgi-bin/koha/catalogue/search.pl
3. "search for" → "call number" and write anything that won't match a
   call number in the field
4. Then you should see
   «No results match your search for 'callnum,phr: [...]»
5. Go to the staff homepage
6. Click on "Search the catalog"
7. Do the same search as previouly
8. Then you should see
   «No results match your search for 'callnum,wrdl: [...]»
   This shows that IntranetNumbersPreferPhrase isn't honored
9. Apply this patch
10. Redo the same two searches and see that phr will now be always used.
    So IntranetNumbersPreferPhrase is honored

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Comment 3 Katrin Fischer 2017-12-29 06:45:41 UTC
Created attachment 70197 [details] [review]
Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase

This patch
- fixes callnum and sn
- Removes unecessary syspref transmission to the template.
  As the template directly reads the syspref

Test plan:
1. Set sysprefs IntranetCatalogSearchPulldown and
   IntranetNumbersPreferPhrase to true
2. Go to staff:/cgi-bin/koha/catalogue/search.pl
3. "search for" → "call number" and write anything that won't match a
   call number in the field
4. Then you should see
   «No results match your search for 'callnum,phr: [...]»
5. Go to the staff homepage
6. Click on "Search the catalog"
7. Do the same search as previouly
8. Then you should see
   «No results match your search for 'callnum,wrdl: [...]»
   This shows that IntranetNumbersPreferPhrase isn't honored
9. Apply this patch
10. Redo the same two searches and see that phr will now be always used.
    So IntranetNumbersPreferPhrase is honored

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2018-01-02 14:45:00 UTC
I do not recreate the bug, and I do not understand the fix. Could you detail please?

(In reply to Victor Grousset/tuxayo from comment #0)
> It's very likely to also affect the OPAC

Does it?
Comment 5 Katrin Fischer 2018-01-02 15:25:40 UTC
It doesn't effect the OPAC from what I could tell when testing.
 
It just switches the indexes in the new search options pull down on the simple search according to the pref from ,wrdl to ,phr for callnumber, copying the existing behaviour for advanced search.
Comment 6 Jonathan Druart 2018-01-02 16:00:44 UTC
Note to myself: the variable is not sent from all the scripts that include search_indexes.inc.

Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2018-01-15 16:47:35 UTC
Awesome work all, pushed to stable for 17.11.02
Comment 8 Fridolin SOMERS 2018-01-22 10:57:45 UTC
Pushed to 17.05.x for v17.05.08