Bug 18305

Summary: jquery.fixFloat.js breaks advanced MARC editor for some browsers
Product: Koha Reporter: David Gustafsson <glasklas>
Component: CatalogingAssignee: David Gustafsson <glasklas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: brendan, jonathan.druart, katrin.fischer, lucy.vaux-harvey, m.de.rooy, magnus, mirko, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 16400    
Bug Blocks:    
Attachments: Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor

Description David Gustafsson 2017-03-20 14:08:25 UTC
Get the following errors editing a bibliographic record:

"Uncaught SyntaxError: Unexpected token ="

and

"addbiblio.pl:294 Uncaught TypeError: $(...).fixFloat is not a function"

which breaks the advanced MARC editor (and potentially other things as well).

This is caused by the following line in koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js:

"$.fn.fixFloat = function (options={}) {"

I'm running Chromium 47 which does not support parameter defaults (added in 49). Internet Explorer (besides edge) and Opera has no support. Since everything seems to work fine when fixing this it seems a shame to let this minor snippet screw up support for so many browser versions.
Comment 1 David Gustafsson 2017-03-20 14:21:46 UTC
Created attachment 61303 [details] [review]
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor

Remove use of ECMASCRIPT 2015 default parameter syntax in
jquery.fixFloat.js to be compatible
with a wider range of browser versions.

Test plan:
  1. Usa a not so modern browser, for example Chrome/Chromium < 49, any version of IE
  besides Edge, Opera, or Firefox < 15.0.
  2. Edit a bibliographic record in staff client and try switching to
  advanced MARC editor (check console, no errors should appear).
Comment 2 Mirko Tietgen 2017-03-22 15:51:41 UTC
*** Bug 17878 has been marked as a duplicate of this bug. ***
Comment 3 Mirko Tietgen 2017-03-22 15:59:46 UTC
Created attachment 61474 [details] [review]
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor

Remove use of ECMASCRIPT 2015 default parameter syntax in
jquery.fixFloat.js to be compatible
with a wider range of browser versions.

Test plan:
  1. Usa a not so modern browser, for example Chrome/Chromium < 49, any version of IE
  besides Edge, Opera, or Firefox < 15.0.
  2. Edit a bibliographic record in staff client and try switching to
  advanced MARC editor (check console, no errors should appear).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Comment 4 Jonathan Druart 2017-03-22 17:09:59 UTC
Created attachment 61488 [details] [review]
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor

Remove use of ECMASCRIPT 2015 default parameter syntax in
jquery.fixFloat.js to be compatible
with a wider range of browser versions.

Test plan:
  1. Usa a not so modern browser, for example Chrome/Chromium < 49, any version of IE
  besides Edge, Opera, or Firefox < 15.0.
  2. Edit a bibliographic record in staff client and try switching to
  advanced MARC editor (check console, no errors should appear).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Brendan Gallagher 2017-03-23 08:43:14 UTC
Pushed to Master - Should be in the 17.05 release.  Thanks!
Comment 6 David Gustafsson 2017-03-23 12:29:10 UTC
Great! Thanks for the quick response!
Comment 7 Jonathan Druart 2017-03-23 14:30:13 UTC
Thanks for the patch David!
Comment 8 Katrin Fischer 2017-03-26 20:28:43 UTC
This patch has been pushed to 16.11.x and will be in 16.11.06.
Comment 9 Magnus Enger 2017-04-05 09:41:24 UTC
*** Bug 18353 has been marked as a duplicate of this bug. ***
Comment 10 Mason James 2017-05-03 01:09:42 UTC
Pushed to 16.05.x, for 16.05.12 release