Bugzilla – Attachment 183328 Details for
Bug 40161
New translation not displayed when translating an item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40161: (bug 38255 follow-up) Fix item type translation JS error
Bug-40161-bug-38255-follow-up-Fix-item-type-transl.patch (text/plain), 2.51 KB, created by
Owen Leonard
on 2025-06-18 12:42:14 UTC
(
hide
)
Description:
Bug 40161: (bug 38255 follow-up) Fix item type translation JS error
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-06-18 12:42:14 UTC
Size:
2.51 KB
patch
obsolete
>From 46964da839208235d32131ff406c89ec74992db4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Jun 2025 13:42:28 +0200 >Subject: [PATCH] Bug 40161: (bug 38255 follow-up) Fix item type translation JS > error > >Uncaught (in promise) TypeError: table.row is undefined > >We need to use the DataTable object. > >Test plan: >Have several languages installed >Edit an item type and click "Translate into other languages" to open >the modal >Translate into another language and note that: >Without this patch you get a JS error in the browser console and the >row is not added to the table >With this patch applied the row is added correctly with your translation > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../intranet-tmpl/prog/en/modules/admin/localization.tt | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >index 199502cdafc..e49f2ac5278 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >@@ -198,11 +198,12 @@ > $(document).ready(function() { > $(".dialog").hide(); > >- var table = $("#localization").kohaTable({ >+ let table = $("#localization").kohaTable({ > dom: "t", > paging: false, > autoWidth: false, > }); >+ let table_dt = table.DataTable(); > > var languages_select = $('<select name="lang" id="lang"></select>'); > [% FOR language IN languages %] >@@ -275,7 +276,7 @@ > if ( success.error ) { > show_message({ type: 'error_on_insert', data: success }); > } else { >- var new_row = table.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node(); >+ var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node(); > $( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id ); > show_message({ type: 'success_on_insert', data: success }); > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40161
:
183327
| 183328