Search result highlighting is broken and has been broken for a long time: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11270 Adding insult to injury there is no way to deactivate it on the staff interface. We are so used to see it that we don't pay attention, but new users notice it, and complain. It would be good to remove it until it is fixed. (As a general rule i think features that aren't entirely functional shouldn't make it into the release until they are actually ready.)
Discussed with Owen at the hackfest, removing it could be disturbing for some users even though it is clearly not working. The way to go would be to add a system preference so we can disable it. Changing the title of the bug accordingly.
It works to a certain extend - it higlights words from your search in the results. It could work better, yes, but it's not totally broken. A pref seems fine to me.
+1 on adding a pref to disable! (I wouldn't mind if the functionality was removed altogether either.)
+1 we've actually had comments / complaints from users who don't like it. Would love to switch it off or remove it completely. (In reply to Andreas Hedström Mace from comment #3) > +1 on adding a pref to disable! > > (I wouldn't mind if the functionality was removed altogether either.)
(In reply to Elaine Bradtke from comment #4) > +1 we've actually had comments / complaints from users who don't like it. > Would love to switch it off or remove it completely. > (In reply to Andreas Hedström Mace from comment #3) > > +1 on adding a pref to disable! > > > > (I wouldn't mind if the functionality was removed altogether either.) You can already deactivate it on the OPAC: HighlightOwnItemsOnOPAC
(In reply to Katrin Fischer from comment #5) We deactivated it in the OPAC. Shortly after we activated it. > You can already deactivate it on the OPAC: HighlightOwnItemsOnOPAC
*** Bug 11525 has been marked as a duplicate of this bug. ***
Created attachment 128359 [details] [review] Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "HighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface).
Shouldn't we store it as a user's setting in local storage instead?
I reproduced the same behavior than OPAC side and from the discussion it coincided with the integration of a system preference. If we put this parameter in the localstorage could problems arise? Like using a browser that is set to not store anything in the localstorage or simply the library that would prefer not to store anything there. I am not against it but I question to raise possible problems with its storage. Especially since the system preference allows not to highlight certain words.
In my opinion sysprefs should not drive UI's preferences. We are using local storage for several features already so that should not be a problem. See bug 5697 for instance, that have been pushed recently, or bug 24958.
I think that the existence of OpacHighlightedWords makes it logical to add a preference for the staff interface. I agree that the "stopwords" option is important to have. I think it might also be good to preserve the user's highlight/unhighlight choice in local storage so that it is preserved across their session.
Why do we need the syspref if each user can decide if they want the feature? We could (later) remove OpacHighlightedWords and use local storage for OPAC as well. The reason I see would be to turn it off globally, but I don't think it's useful.
I agree, it's like "killing an ant with a tank" to remove the highlight by adding a syspref, run updatedatabase.pl, add a conditioner... etc. I wanted to keep the same behavior as OPAC for some unity of operation. If we plan to remove OPACHighlightedWords later, it may be easier to add it to localstorage by a little js code for now.
(In reply to Jonathan Druart from comment #13) > Why do we need the syspref if each user can decide if they want the feature? > We could (later) remove OpacHighlightedWords and use local storage for OPAC > as well. > > The reason I see would be to turn it off globally, but I don't think it's > useful. We had requests to turn it off in the OPAC and also the staff interface. I think that it's by default 'on' is an issue that can be annoying. People are often irritated that everything is highlighted instead of only highlighting the words int he fields they searched in. I think having a pref here would be helpful.
What I am trying to say: this is a feature that is not wanted by some and we have a lot of feature on/off switches. I don't see the difference with this one? Having it in localstorage would be nice, but then I think we also should have a pref to set the default (highlight or not highlight). The unhighlight option is often missed.
For now maybe someone can test my patch and tell if it's appropriate or not ? "Highlighting" and "Unhighlighting" options are still possible on the go when syspref isn't set to "Highlight" (by default) but if you disable highlighting you will didn't see any highlighting after that
Because it can concerned other syspref and this can be interesting to develop more I created https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29701
I have tested this and it works as expected. I would suggest these changes: 1. System preference name: change from HighlightedWords to StaffHighlightedWords 2.System preference wording: . Current: Don't highlight|Highlight words the patron searched for in their search results and detail pages. . Suggested: Don't highlight|Highlight words searched for in the staff interface search results pages. . Notes: For me the highlighting is only working on the search listing results pages, not on the record detail pages. - Location in the system preferences area: I would put under Staff interface > Appearance as this is consistent with the OPAC system preference, rather than under Searching > Results display. - Enable highlighting by default: as this is a change in the default behavour I would tend to leave the default (highlighting) enabled, rather than disabling it (that is, set the default to Highlight).
Created attachment 130396 [details] [review] Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "HighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface).
(In reply to David Nind from comment #19) > I have tested this and it works as expected. I would suggest these changes: > > 1. System preference name: change from HighlightedWords to > StaffHighlightedWords > > 2.System preference wording: > . Current: Don't highlight|Highlight words the patron searched for in > their search results and detail pages. > . Suggested: Don't highlight|Highlight words searched for in the staff > interface search results pages. > . Notes: For me the highlighting is only working on the search listing > results pages, not on the record detail pages. > > - Location in the system preferences area: I would put under Staff > interface > Appearance as this is consistent with the OPAC system > preference, rather than under Searching > Results display. > > - Enable highlighting by default: as this is a change in the default > behavour I would tend to leave the default (highlighting) enabled, rather > than disabling it (that is, set the default to Highlight). Hello David, Thanks for you feedback :) I completely understand your notes, I'm agree for the syspref name : the more precise, the better it will be. Also for the description, my english is not as good as i would like ^^ so I change this too. And for the location... yes totally correct and adequate I concede it, like the default behavior as you notice. So I push again the patch with all this changes, thanks to tell me your opinion :) And if other people test it of course we can discuss
(In reply to Thibaud Guillot from comment #21) > Also for the description, my english is not as good as i would like ^^ so I > change this too. Hi Thibaud. Thanks for incorporating my suggestions - writing things in another language can be challenging, so hopefully that is where testing can help! I've retested, but for some reason highlighting doesn't seem to be working for me now - with either 'Highlight' or 'Don't highlight' selected for the new system preference. Also, I would suggest: - Setting the default to 'Highlight' (that is, leave the current behavour in place) (I'm not a developer, but from reading the code it should do that, but I'm not sure why it isn't). - For the patch add the bug number at the start, that is: Bug 20398: Added... (the QA Team will most likely pick this up). David
Created attachment 130420 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "HighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface).
(In reply to David Nind from comment #22) > (In reply to Thibaud Guillot from comment #21) > > > Also for the description, my english is not as good as i would like ^^ so I > > change this too. > Hi Thibaud. > > Thanks for incorporating my suggestions - writing things in another language > can be challenging, so hopefully that is where testing can help! > > I've retested, but for some reason highlighting doesn't seem to be working > for me now - with either 'Highlight' or 'Don't highlight' selected for the > new system preference. > > Also, I would suggest: > > - Setting the default to 'Highlight' (that is, leave the current behavour in > place) (I'm not a developer, but from reading the code it should do that, > but I'm not sure why it isn't). > > - For the patch add the bug number at the start, that is: Bug 20398: > Added... (the QA Team will most likely pick this up). > > David Yes David you are absolutely right, yesterday when I rebased the patch I forgot to change some variable names on the script that manages the feature... my apologies, now its works. And I adjust the commit by the way with the bug number :)
Patch no longer applies 8-(... things move too fast sometimes! Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/js/pages/results.js Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/js/pages/results.js CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/js/pages/results.js error: Failed to merge in the changes. Patch failed at 0001 Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface
(In reply to Thibaud Guillot from comment #24) > > Yes David you are absolutely right, yesterday when I rebased the patch I > forgot to change some variable names on the script that manages the > feature... my apologies, now its works. And I adjust the commit by the way > with the bug number :) No worries and excellent!
Created attachment 130426 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "HighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface).
(In reply to David Nind from comment #25) > Patch no longer applies 8-(... things move too fast sometimes! > > Apply? [(y)es, (n)o, (i)nteractive] y > Applying: Bug 20398 : Added a syspref to highlight or not highlight search > terms in results on the staff interface > Using index info to reconstruct a base tree... > M koha-tmpl/intranet-tmpl/prog/js/pages/results.js > Falling back to patching base and 3-way merge... > Auto-merging koha-tmpl/intranet-tmpl/prog/js/pages/results.js > CONFLICT (content): Merge conflict in > koha-tmpl/intranet-tmpl/prog/js/pages/results.js > error: Failed to merge in the changes. > Patch failed at 0001 Bug 20398 : Added a syspref to highlight or not > highlight search terms in results on the staff interface Normally I solved the conflict, thanks to you
Created attachment 130429 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "HighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface). Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
This patch applies. I encountered problems this morning (patch uninstalled or ineffective) but they seem solved.
(but the name of the syspref is 'StaffHighlightedWords')
Created attachment 130446 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "StaffHighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface).
(In reply to e.betemps from comment #31) > (but the name of the syspref is 'StaffHighlightedWords') yes.. I saw that I forgot to change the name in my test plan with latest changes... this is fixed now, thanks for your feedback
Created attachment 130450 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "StaffHighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface). Signed-off-by: ManuB <e.betemps@gmail.com>
Created attachment 130531 [details] [review] Bug 20398 : Added a syspref to highlight or not highlight search terms in results on the staff interface There is a possibility on OPAC but not yet on the staff interface, so I added this syspref which has the same behaviour as the OPAC highlighting syspref. When you choose to disable highlighting on the syspref, the toggle anchor in the result page does not appear at all. But if you keep the default state (highlighting on), you still have the option to switch between "Unhighlight" and "Highlight" modes. Test plan : 1. Go to the syspref named "StaffHighlightedWords" and see that the default state is "Highlight". 2. Look for something in the catalogue for example and see that the words are highlighted and that it is also possible to change between "Unhighlight" and "Highlight". 3. Go back to syspref and choose to disable highlighting by choosing "Don't Highlight". 4. Refresh your results page if you have not closed it or reload a new search. 5. There is no highlighting at all and anchors do not exist (same behaviour as the OPAC interface). Signed-off-by: ManuB <e.betemps@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 130532 [details] [review] Bug 20398: (QA follow-up) Fix alphabetical order in sysprefs.sql Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Hi Thibaud, 1) Commit message Please make sure to run the QA test tools on your patches - they can highlight things like mistakes with the commit message and give other helpful hints. In this case there is an extra space that needs to be removed: Bug xxxx : should be Bug xxxx: 2) b/installer/data/mysql/mandatory/sysprefs.sql This file is sorted alphabetically, as you are dealing with librarians here, we take this seriously :) 3) Database update For some time we are using a new format for database updates, see here: https://wiki.koha-community.org/wiki/Database_updates That's for next time.
Hi Katrin, Thanks to you, I will remember that :)
In results.js : Shouldn't block : if( PREF_StaffHighlightedWords == 1 ){ highlightOn(); } else { highlightOff(); } Be inside : if( search_result.query_desc ) ?
Created attachment 132414 [details] [review] Bug 20398: (QA Follow-up) Fix position of 'if' statement
Commit messages corrected : no space before ':' Follow-up => follow-up
Pushed to master for 22.05, thanks to everybody involved [U+1F984]