Bug 5844 - Unhighlight cuts off some strings
Summary: Unhighlight cuts off some strings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 16:02 UTC by Stefano Bargioni
Modified: 2021-11-26 10:54 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 5844: Avoid strings cut on unhighlighing (1.80 KB, patch)
2015-03-26 14:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 5844: Avoid strings cut on unhighlighing (2.01 KB, patch)
2015-03-26 15:27 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 5844: Avoid strings cut on unhighlighing (1.96 KB, patch)
2015-03-27 13:54 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stefano Bargioni 2011-03-09 16:02:20 UTC
When searching using more than one word, if one of them is contained in a previous one, unhilight button cuts some chars off the result page.
Test with "manual nu" or something similar.
Reason: highlight generates
<span class="term">Ma<span class="term">nu</span>al</span>
and unhighlight leaves only "Ma".
Note that the bug is not visible if the search is "nu manual".
Comment 1 Katrin Fischer 2012-03-19 05:56:33 UTC
I can confirm this bug on current master. My search was "Didaktik da".
Comment 2 Owen Leonard 2012-11-26 21:04:31 UTC
This bug applies to the new highlight feature on the detail page as well.
Comment 3 Jonathan Druart 2015-03-26 14:10:14 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2015-03-26 15:27:12 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2015-03-27 13:54:11 UTC
Created attachment 37317 [details] [review]
[PASSED QA] Bug 5844: Avoid strings cut on unhighlighing

If a user is searching for several words and that one is contained in
another ( "mag ma" ), some characters are cut (removed from the DOM!).

To reproduce:
1/ search for "mag ma m"
2/ The result page contains "Magazine"
3/ "Mag" is highlighted
4/ Click on the "Unhighlight" link
5/ The "Magazine" words become "azine", "Mag" has been cut.
There is no way to show these characters again.

Test plan:
1/ Confirm the bad behavior without this patch
2/ Apply this patch
3/ search for "mag ma m"
4/ The result page contains "Magazine"
5/ "Mag" is highlighted
6/ Click on the "Unhighlight" link
7/ strings are unhighlighted and still in the DOM :)

Note that the Highlight link won't work very well (only "a" will be
highlighted, but considered as minor since this did not work before the
patch neither).

Followed test plan. Strings are no longer cut when unhiglighted.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi 2015-03-31 14:02:15 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 7 Chris Cormack 2015-04-02 20:23:56 UTC
Pushed to 3.18.x will be in 3.18.6