Bug 37231 - (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES
Summary: (Bug 34940 follow-up) Highlight logged-in library in facets does not work wit...
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Janusz Kaczmarek
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 34940
Blocks:
  Show dependency treegraph
 
Reported: 2024-07-02 12:37 UTC by Janusz Kaczmarek
Modified: 2024-12-06 08:18 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES (1.82 KB, patch)
2024-07-02 12:43 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 37231: (Bug 34940 follow-up) Highlight logged-in library in facets does not work with ES (1.87 KB, patch)
2024-07-02 21:50 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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