Bug 21024 - JS error on search result breaks JS functionalities
Summary: JS error on search result breaks JS functionalities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 20864
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-29 17:56 UTC by Jonathan Druart
Modified: 2019-10-14 19:57 UTC (History)
5 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:


Attachments
Bug 21024: (bug 20864 follow-up) Only set bibs_selected cookie when BrowseResultSelection is activated (5.65 KB, patch)
2018-06-29 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated" (1.13 KB, patch)
2018-06-29 18:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated" (1.18 KB, patch)
2018-07-01 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated" (1.28 KB, patch)
2018-07-06 06:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-06-29 17:56:41 UTC
Caused by bug 20864, some JS functions defined in commons.js are called by search.pl

The JS error is:
  ReferenceError: resetSearchContext is not defined

It breaks add to basket, list, etc.
Comment 1 Jonathan Druart 2018-06-29 18:04:24 UTC
Created attachment 76579 [details] [review]
Bug 21024: (bug 20864 follow-up) Only set bibs_selected cookie when BrowseResultSelection is activated

This is an attempt to fix correctly the problem bug 20864 tried to
solve.

The cookie bibs_selected must only be defined if BrowseResultSelection
is set.
Bug 20864 removed the inclusion of commons.js, but some code from
results.tt

We should include it and take care of the pref in each function.

Test plan:
Retest 19290 and 20864
Comment 2 Jonathan Druart 2018-06-29 18:40:07 UTC
Created attachment 76583 [details] [review]
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated"

This reverts commit ce6ec1e7faef217950e3450788ea444dad26d7c0.
Comment 3 Jonathan Druart 2018-06-29 18:41:03 UTC
It's too hard to get rid of the cookie. It is used for add to cart and list selection. The safer is to keep and use it, even if the pref is turned off.
Comment 4 Katrin Fischer 2018-07-01 17:32:39 UTC
I've changed the documentation on the wiki - can you please check if it's correct now? https://wiki.koha-community.org/wiki/Use_of_Cookies
Comment 5 Katrin Fischer 2018-07-01 17:36:03 UTC
Created attachment 76600 [details] [review]
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated"

This reverts commit ce6ec1e7faef217950e3450788ea444dad26d7c0.

https://bugs.koha-community.org/show_bug.cgi?id=21024

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2018-07-03 13:13:25 UTC
(In reply to Katrin Fischer from comment #4)
> I've changed the documentation on the wiki - can you please check if it's
> correct now? https://wiki.koha-community.org/wiki/Use_of_Cookies

It's used to add records to a list as well.
Comment 7 Katrin Fischer 2018-07-03 20:08:29 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Katrin Fischer from comment #4)
> > I've changed the documentation on the wiki - can you please check if it's
> > correct now? https://wiki.koha-community.org/wiki/Use_of_Cookies
> 
> It's used to add records to a list as well.

Updated the cookie documentation, thx!
Comment 8 Marcel de Rooy 2018-07-06 06:04:18 UTC
Created attachment 76714 [details] [review]
Revert "Bug 20864: Only set bibs_selected cookie when BrowseResultSelection is activated"

This reverts commit ce6ec1e7faef217950e3450788ea444dad26d7c0.

https://bugs.koha-community.org/show_bug.cgi?id=21024

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Nick Clemens 2018-07-06 14:40:45 UTC
Awesome work all!

Pushed to master for 18.11
Comment 10 Martin Renvoize 2018-07-18 12:27:48 UTC
Also reverted in 18.05.x for 18.05.02.