Bug 28349: (bug 26234 follow-up) Correct wrong array merge
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 7 Oct 2021 10:17:51 +0000 (12:17 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 28 Oct 2021 10:16:37 +0000 (12:16 +0200)
commitde6a37312604b818c846a7bd048f9d95f2f7f0ee
tree9c5f6999b0d155c94a557c8cf63e13a73e71f8e7
parent5b0962028763c4e36bc6d05fd07513b0f10754bd
Bug 28349: (bug 26234 follow-up) Correct wrong array merge

Bug 26234 allowed to remove the different classes we use in aoColumnDefs
for sorting columns of table using DT.

However there is a terrible mistake, the merge of existing aoColumnDefs
array with the default one is totally wrong:
  $.extend(true, new_parameters, default_column_defs);
When we actually wanted to do:
  $.extend(true, new_parameters["aoColumnDefs"], default_column_defs);

But it's still wrong, extend is doing a deep copy and the array will be
replaced by the other one, whereas we want to append.

We want to merge default_column_defs with the existing aocolumnDefs,
this patch is doing it explicitely.

This bug only exists when there is an existing aocolumnDefs.

See commit d3f3a55e0b1544ebcd3166d141e126a4324baab1
It happens on:
 * cataloguing/z3950_search.tt
 * reports/guided_reports_start.tt
 * serials/subscription-detail.tt
 * opac-course-reserves.tt
 * opac-detail.tt

However this bug has been hidden as we have in master related bug from
bug 27945, which removes title-string.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc