Bug 20806: Do not rely on column position
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 29 Jun 2018 20:30:39 +0000 (17:30 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 18 Jul 2018 17:01:46 +0000 (17:01 +0000)
It is not the first time we have this splice call, it seems safer to
rely on the column's name instead of the column's position

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt

index ff19d79..8ba606f 100644 (file)
             var columns_settings = [% ColumnsSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %];
             [% UNLESS show_itemtype_column %]
               //Remove item type column settings
-              columns_settings.splice(8,1);
+              columns_settings = columns_settings.filter(function(c){return c['columnname'] != 'itemtype';});
             [% END %]
             var table = KohaTable("table_holdshistory", {
                 "sPaginationType": "four_button",