Bug 38353 - DT - Possible hidden bugs caused by $.extend
Summary: DT - Possible hidden bugs caused by $.extend
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 10:37 UTC by Jonathan Druart
Modified: 2024-11-05 10:38 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-11-05 10:37:24 UTC
Possible bugs could be hidden behind the use of $.extend when we merge DT's options.

We are using (almost everywhere):
$(selector).dataTable($.extend(true, {}, dataTablesDefaults, {

But:

var dataTablesDefaults = { "lengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, __('All')]] };
var mine = {lengthMenu: [[1, 2, 5, 10], [1, 2, 5, 10]]}; 
$.extend(true, {}, dataTablesDefaults, mine);

[
  1,
  2,
  5,
  10,
  -1
]

See also bug 30397.