Bug 28488

Summary: Javascript error in self-checkout (__ is not defined)
Product: Koha Reporter: David Cook <dcook>
Component: Self checkoutAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle, oleonard, victor
Version: master   
Hardware: All   
OS: All   
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
Bug Depends on:    
Bug Blocks: 32701    
Attachments: Bug 28488: Javascript error in self-checkout (__ is not defined)
Bug 28488: Javascript error in self-checkout (__ is not defined)
Bug 28488: Javascript error in self-checkout (__ is not defined)

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.