Bug 21989 - JS error in "Add orders from MARC file" - addorderiso2709.pl
Summary: JS error in "Add orders from MARC file" - addorderiso2709.pl
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 19753
Blocks:
  Show dependency treegraph
 
Reported: 2018-12-12 15:17 UTC by Jonathan Druart
Modified: 2019-02-06 13:18 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl (9.71 KB, patch)
2019-01-14 14:25 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl (9.77 KB, patch)
2019-01-25 21:42 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl (9.83 KB, patch)
2019-01-26 12:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21989: [18.05.x] JS error in "Add orders from MARC file" - addorderiso2709.pl (16.19 KB, patch)
2019-02-06 13:18 UTC, Owen Leonard
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-12-12 15:17:49 UTC
On addorderiso2709.pl there is a JS error "ReferenceError: $ is not defined"

It comes from
  commit 1a132440766277d6d94246a86ec671b79de7a442
  Bug 19753: Move template JavaScript to the footer: Acquisitions

From Owen on #koha:
"""
That's just poor testing on my part, and the change to that file should be undone. There's currently no good way to handle cataloging plugin JS with all other JS in the footer
"""
Comment 1 Katrin Fischer 2019-01-13 21:58:44 UTC
Owen, could you have a look maybe? Is this an urgent one?
Comment 2 Owen Leonard 2019-01-14 14:25:35 UTC
Created attachment 83889 [details] [review]
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl

This patch undoes the changes to addorderiso2709.tt introduced by Bug
19753. The item information tab can include embedded JavaScript for
cataloging plugins, and these don't currently work with JS in the
footer.

To test, apply the patch and test the JavaScript driven features of the
"Add to basket from a staged file" page:

  - Acquisitions -> Vendor -> Basket -> Add to basket from a staged file
    - MARC and Card previews, select all/clear all
    - Item information tab: Cataloging plugins for fields like date
      acquired, barcode
    - Default accounting details tab: Show inactive control
Comment 3 Maryse Simard 2019-01-25 21:42:44 UTC
Created attachment 84440 [details] [review]
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl

This patch undoes the changes to addorderiso2709.tt introduced by Bug
19753. The item information tab can include embedded JavaScript for
cataloging plugins, and these don't currently work with JS in the
footer.

To test, apply the patch and test the JavaScript driven features of the
"Add to basket from a staged file" page:

  - Acquisitions -> Vendor -> Basket -> Add to basket from a staged file
    - MARC and Card previews, select all/clear all
    - Item information tab: Cataloging plugins for fields like date
      acquired, barcode
    - Default accounting details tab: Show inactive control

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 4 Katrin Fischer 2019-01-26 12:44:17 UTC
Created attachment 84445 [details] [review]
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl

This patch undoes the changes to addorderiso2709.tt introduced by Bug
19753. The item information tab can include embedded JavaScript for
cataloging plugins, and these don't currently work with JS in the
footer.

To test, apply the patch and test the JavaScript driven features of the
"Add to basket from a staged file" page:

  - Acquisitions -> Vendor -> Basket -> Add to basket from a staged file
    - MARC and Card previews, select all/clear all
    - Item information tab: Cataloging plugins for fields like date
      acquired, barcode
    - Default accounting details tab: Show inactive control

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2019-01-26 12:45:05 UTC
Ignoring the QA script fail as invalid in this case (see commit message):

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
   OK	  filters
   OK	  forbidden patterns
   OK	  git manipulation
   FAIL	  js_in_body
		A <script> tag found inside head, must be moved to the body (see bug 17858)
Comment 6 Nick Clemens 2019-01-28 14:15:23 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-02-01 11:53:40 UTC
Pushed to 18.11.x for 18.11.03
Comment 8 Lucas Gass 2019-02-05 22:03:22 UTC
doesnt cleanly apply to 18.05.x needs rebase
Comment 9 Owen Leonard 2019-02-06 13:18:49 UTC
Created attachment 84815 [details] [review]
Bug 21989: [18.05.x] JS error in "Add orders from MARC file" - addorderiso2709.pl

This patch undoes the changes to addorderiso2709.tt introduced by Bug
19753. The item information tab can include embedded JavaScript for
cataloging plugins, and these don't currently work with JS in the
footer.

To test, apply the patch and test the JavaScript driven features of the
"Add to basket from a staged file" page:

  - Acquisitions -> Vendor -> Basket -> Add to basket from a staged file
    - MARC and Card previews, select all/clear all
    - Item information tab: Cataloging plugins for fields like date
      acquired, barcode
    - Default accounting details tab: Show inactive control