In my tests this series of OPAC searches will result a browser crash (Firefox) or an endlessly loading tab (Chrome): 1. Perform a keyword search which will return a good number of results. 2. Click on a title in those results which will have a good number of works by that author. 3. Click on the author link on the detail page to perform a search by author. 4. Click on a facet on the author search results page (I tested by clicking on a library facet). 5. Click on a title in the refined search results. I've tested this procedure with XSLT on and off, with OpacBrowseResults on and off, and with EnableOpacSearchHistory on and off. I get the same results in both themes.
More info: The bug appears to affect master and 3.12.x but not 3.10.x. I couldn't reproduce the problem in the staff client following the same steps.
Don't you think this bug priority needs to be reevaluated? Random browser crashes are a really nasty issue... I suppose it is linked with the browser crashes I experienced each time I tried to test Jonathan Druart's patch made for making facets cancellable (Bug 10857) Mathieu
I could reproduce endless loops as well, leading to a "Script not responding" message in Firefox. What I did: - Keyword search for "a" - In Facets click an author with a lot of titles - Click a detail page Result: Wait cursor, then "Script not responding" It seems to be related to a function jQuery.fn.higlight It has a loop like for (var i=0; i < node.childNodes.lenght; ++i) in this loop, node.childNodes.lenght is really huge (sorry, could not take a screenshot) After turning off syspref 'OpacHighlightedWords' I could not reproduce the endless loop again.
Created attachment 33662 [details] Screenshot debugger after script not responding Screenshot of debugger after getting "Script not responding" (Firefox)
Created attachment 33667 [details] [review] [HACK] Bug 10956 - Series of OPAC searches can cause a browser crash This is a hack to track down the issue with an endless loop while highlighting words. I changed function innerHighlight(node, pat) to break out of loop after a while. With this hack I can no longer reproduce the bug. It is not a solution, but it could help to track down the problem.
New finding: In facet, click several times on the author. The link will get longer and longer and looks like the following (newlines by mv): http://10.0.0.21/cgi-bin/koha/opac-search.pl?q=ccl= kw%3Aa%20%20 and%20au%3ATwain%2C%20Mark%2C%201835-1910%20 and%20au%3ATwain%2C%20Mark%2C%201835-1910%20 and%20au%3ATwain%2C%20Mark%2C%201835-1910&sort_by=relevance&limit=au:Twain%2C%20Mark%2C%201835-1910 The highlighting function then will try to highlight the words Twain, Mark and 1835-1910 several times. Maybe this breaks the highlighting function.
Comment on attachment 33667 [details] [review] [HACK] Bug 10956 - Series of OPAC searches can cause a browser crash Obsoleted patch that helped to track down issue.
Comment on attachment 33667 [details] [review] [HACK] Bug 10956 - Series of OPAC searches can cause a browser crash Hmm, could not really find out what happens. At least this patch prevents the browser from freezing.
Created attachment 33673 [details] [review] Bug 10956 - Series of OPAC searches can cause a browser crash Solution: Prevent jQuery.fn.highlight = function(pat) to be called with empty pat by skipping empty values in highlight loop. To test: Without patch, do a search as in comment #1 odr #3 Result: Endless loop (Script not responding) Appply patch: No endless loop, page displays OK
This fix is for the bootstrap theme. Earlier fixes were vor the prog them (Bug 9419 and Bug 8646)
Created attachment 33674 [details] [review] Bug 10956 - Series of OPAC searches can cause a browser crash This patch fixes the issue for bootstrap. It was earlier fixed for the prog theme. Solution: Prevent jQuery.fn.highlight = function(pat) to be called with empty pat by skipping empty values in highlight loop. To test: Without patch, do a search as in comment #1 odr #3 Result: Endless loop (Script not responding) Appply patch: No endless loop, page displays OK
Created attachment 33897 [details] [review] Bug 10956 - Series of OPAC searches can cause a browser crash This patch fixes the issue for bootstrap. It was earlier fixed for the prog theme. Solution: Prevent jQuery.fn.highlight = function(pat) to be called with empty pat by skipping empty values in highlight loop. To test: Without patch, do a search as in comment #1 odr #3 Result: Endless loop (Script not responding) Appply patch: No endless loop, page displays OK Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> To reproduce you need to search a string with 2 spaces.
Created attachment 33903 [details] [review] [PASSED QA] Bug 10956 - Series of OPAC searches can cause a browser crash This patch fixes the issue for bootstrap. It was earlier fixed for the prog theme. Solution: Prevent jQuery.fn.highlight = function(pat) to be called with empty pat by skipping empty values in highlight loop. To test: Without patch, do a search as in comment #1 odr #3 Result: Endless loop (Script not responding) Appply patch: No endless loop, page displays OK Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> To reproduce you need to search a string with 2 spaces. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> I didn't manage to reproduce the problem, but I couldn't find any regression either trying multiple searches. Trusting Marc's and Jonathan's testing.
(In reply to Katrin Fischer from comment #13) > Trusting Marc's and Jonathan's testing. I confirm that my browser completely blown-up :) I searched " p. 21 " This problem have already been fixed using the same way on the intranet and in the prod theme.
Patch pushed to master. Thanks Marc!