Bug 42443: (QA follow-up) Fix escaping of branchcode in JS context
Using | html to embed a TT value inside a JS string literal is incorrect: it produces HTML entities rather than JS-safe characters. Store the branchcode in a data attribute (where | html is correct) and read it from there in JavaScript. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
16b2ac663e
commit
19d1db91d2
|
|
@ -39,7 +39,7 @@
|
|||
[% IF ( TransfersMaxDaysWarning ) %]<p>Transfers are <span class="error">considered late</span> after [% TransfersMaxDaysWarning | html %] days.</p>[% END %]
|
||||
<div id="resultlist">
|
||||
<div class="page-section">
|
||||
<table id="transferstoreceive"></table>
|
||||
<table id="transferstoreceive" data-branchcode="[% branchcode | html %]"></table>
|
||||
</div>
|
||||
<!-- /.page-section -->
|
||||
</div>
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
$(document).ready(function () {
|
||||
var additional_filters = {
|
||||
to_library_id: "[% branchcode | html %]",
|
||||
to_library_id: $("#transferstoreceive").data("branchcode"),
|
||||
sent_date: { "!=": null },
|
||||
arrived_date: { "=": null },
|
||||
cancellation_date: { "=": null },
|
||||
|
|
@ -82,15 +82,7 @@
|
|||
language: {
|
||||
emptyTable: _("No transfers to receive"),
|
||||
},
|
||||
embed: [
|
||||
"item+strings",
|
||||
"item.biblio",
|
||||
"item.home_library",
|
||||
"item.item_type",
|
||||
"item.first_hold.patron",
|
||||
"item.recall.patron",
|
||||
"from_library",
|
||||
],
|
||||
embed: ["item+strings", "item.biblio", "item.home_library", "item.item_type", "item.first_hold.patron", "item.recall.patron", "from_library"],
|
||||
order: [[1, "asc"]],
|
||||
columns: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue