Bug 28488 - Javascript error in self-checkout (__ is not defined)
Summary: Javascript error in self-checkout (__ is not defined)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 32701
  Show dependency treegraph
 
Reported: 2021-05-31 04:27 UTC by David Cook
Modified: 2023-04-23 21:19 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.01,20.11.07


Attachments
Bug 28488: Javascript error in self-checkout (__ is not defined) (1.65 KB, patch)
2021-06-07 16:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28488: Javascript error in self-checkout (__ is not defined) (1.70 KB, patch)
2021-06-07 20:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 28488: Javascript error in self-checkout (__ is not defined) (1.75 KB, patch)
2021-06-11 16:58 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2021-05-31 04:27:20 UTC
datatables_20.1200050.js:32 Uncaught ReferenceError: __ is not defined
    at datatables_20.1200050.js:32
Comment 1 Katrin Fischer 2021-06-03 20:30:41 UTC
Confirmed on /cgi-bin/koha/sco/sco-main.pl

I wonder if this could affect translations, as __( is used for Javascript translation.
Comment 2 David Cook 2021-06-03 23:48:39 UTC
I was wondering that as well. 

What's the difference between __() and _()? I've noticed some cases where they'll both be used close to each other.
Comment 3 Katrin Fischer 2021-06-03 23:49:23 UTC
__() is used in .js files, _() in TT files.
Comment 4 David Cook 2021-06-03 23:58:39 UTC
(In reply to Katrin Fischer from comment #3)
> __() is used in .js files, _() in TT files.

Ahh interesting. I wish I remembered where I saw the combo..
Comment 5 Owen Leonard 2021-06-07 16:10:58 UTC
Created attachment 121687 [details] [review]
Bug 28488: Javascript error in self-checkout (__ is not defined)

This patch adds inclusion of the internationalization JavaScript which
is required by the newest version of the DataTables include. It
references the double-underscore function provided by i18n.js.

To test, apply the patch and log into the self-checkout system as a user
with checkouts. The table of checkouts should display correctly and
there should be no JavaScript errors in the console.
Comment 6 David Nind 2021-06-07 20:20:09 UTC
Created attachment 121695 [details] [review]
Bug 28488: Javascript error in self-checkout (__ is not defined)

This patch adds inclusion of the internationalization JavaScript which
is required by the newest version of the DataTables include. It
references the double-underscore function provided by i18n.js.

To test, apply the patch and log into the self-checkout system as a user
with checkouts. The table of checkouts should display correctly and
there should be no JavaScript errors in the console.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Nick Clemens 2021-06-11 16:58:21 UTC
Created attachment 121865 [details] [review]
Bug 28488: Javascript error in self-checkout (__ is not defined)

This patch adds inclusion of the internationalization JavaScript which
is required by the newest version of the DataTables include. It
references the double-underscore function provided by i18n.js.

To test, apply the patch and log into the self-checkout system as a user
with checkouts. The table of checkouts should display correctly and
there should be no JavaScript errors in the console.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Jonathan Druart 2021-06-15 14:28:57 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 9 Kyle M Hall 2021-06-18 14:56:34 UTC
Pushed to 21.05.x for 21.05.01
Comment 10 Fridolin Somers 2021-06-21 13:30:14 UTC
Pushed to 20.11.x for 20.11.07
Comment 11 Victor Grousset/tuxayo 2021-06-22 01:09:18 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.