Bugzilla – Attachment 125875 Details for
Bug 28349
Date sorting incorrect in some tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28349: (bug 26234 follow-up) Correct wrong array merge
Bug-28349-bug-26234-follow-up-Correct-wrong-array-.patch (text/plain), 2.12 KB, created by
Jonathan Druart
on 2021-10-07 13:07:48 UTC
(
hide
)
Description:
Bug 28349: (bug 26234 follow-up) Correct wrong array merge
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-07 13:07:48 UTC
Size:
2.12 KB
patch
obsolete
>From 90d0ba3b2e95fb2794a32ef1b0c0eceeec9bf219 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Oct 2021 12:17:51 +0200 >Subject: [PATCH] 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. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >index 0fd092013e2..a1d80ecbb6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -138,7 +138,9 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > if ( new_parameters["aoColumnDefs"] === undefined ) { > new_parameters["aoColumnDefs"] = default_column_defs; > } else { >- $.extend(true, new_parameters, default_column_defs); >+ $(default_column_defs).each(function(){ >+ new_parameters["aoColumnDefs"].push(this); >+ }); > } > > table.dataTable(new_parameters); >-- >2.25.1
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 28349
:
125870
|
125875
|
126179
|
127028