Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor for some browsers
Summary: jquery.fixFloat.js breaks advanced MARC editor for some browsers
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: David Gustafsson
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 17878 18353 (view as bug list)
Depends on: 16400
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-20 14:08 UTC by David Gustafsson
Modified: 2017-05-03 01:09 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor (1.33 KB, patch)
2017-03-20 14:21 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor (1.38 KB, patch)
2017-03-22 15:59 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 18305 - jquery.fixFloat.js breaks advanced MARC editor (1.45 KB, patch)
2017-03-22 17:09 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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