Description
Owen Leonard
2013-09-26 17:11:09 UTC
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 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! |