Bug 37231

Summary: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: TemplatesAssignee: Janusz Kaczmarek <januszop>
Status: Pushed to oldoldstable --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, lucas
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:
Bug Depends on: 34940    
Bug Blocks:    
Attachments: Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES
Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES

Description Janusz Kaczmarek 2024-07-02 12:37:06 UTC
The highlight logged-in library in facets feature does not work with Elasticsearch.  This is because facet_title_value contains an additional " (count)" information and so gives negative results in comparisons made in facets.inc  (line 107).
Comment 1 Janusz Kaczmarek 2024-07-02 12:43:59 UTC
Created attachment 168361 [details] [review]
Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES

The highlight logged-in library in facets feature does not work with
Elasticsearch.  This is because facet_title_value contains an additional
" (count)" information and so gives negative results in comparisons made
in facets.inc  (line 107).

Test plan:
==========
1. Have a test installation with Elastiscsearch.
2. Set system preference 'DisplayLibraryFacets' to 'both home and holding libraries'
3. Perform a seach that will find items of your logged-in library.
   In KTD, search for 'branch:CPL'
4. Check the facet (home and holding libraries) of your logged-in
   library is not highlighted
5. Apply the patch ; restart_all.
6. Repeat p. 3.  Check the facet (home and holding libraries)--you
   should see your logged-in branch highlighted now.

Sponsored-by: Ignatianum University in Cracow
Comment 2 Roman Dolny 2024-07-02 21:50:00 UTC
Created attachment 168407 [details] [review]
Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES

The highlight logged-in library in facets feature does not work with
Elasticsearch.  This is because facet_title_value contains an additional
" (count)" information and so gives negative results in comparisons made
in facets.inc  (line 107).

Test plan:
==========
1. Have a test installation with Elastiscsearch.
2. Set system preference 'DisplayLibraryFacets' to 'both home and holding libraries'
3. Perform a seach that will find items of your logged-in library.
   In KTD, search for 'branch:CPL'
4. Check the facet (home and holding libraries) of your logged-in
   library is not highlighted
5. Apply the patch ; restart_all.
6. Repeat p. 3.  Check the facet (home and holding libraries)--you
   should see your logged-in branch highlighted now.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Katrin Fischer 2024-07-12 08:09:57 UTC
Got a bit confused here, but it looks like it only works in the staff interface!
Comment 4 Katrin Fischer 2024-07-12 08:22:14 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Janusz Kaczmarek 2024-07-12 12:01:50 UTC
(In reply to Katrin Fischer from comment #3)
> Got a bit confused here, but it looks like it only works in the staff
> interface!

This is right.  The Fridolin's intention in Bug 34940 was to correct intranet-tmpl/prog/en/includes/facets.inc only.  Here I just fixed what was not working for ES.  If somebody wanted to extend Bug 34940 to OPAC, the current fix for ES should work as well without additional changes.
Comment 6 Lucas Gass (lukeg) 2024-11-18 18:07:25 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 7 Fridolin Somers 2024-12-06 08:18:33 UTC
Pushed to 23.11.x for 23.11.11