From 43c1547aead37ae3960df8d8dc942ef2ea91cb2d Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Thu, 16 Dec 2021 11:57:12 +0100
Subject: [PATCH] Bug 29648: Add item - broken FIXME

Why don't we have the columns visibility button?

It looks like there is something broken here, why don't we have the
show/hide columns buttons? The code expects it to be displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
---
 .../intranet-tmpl/prog/en/includes/str/cataloging_additem.inc | 2 +-
 koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc
index 02c403cb5f1..1a2009d6f13 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc
@@ -20,6 +20,6 @@
     var MSG_CONFIRM_DELETE_ITEM = _("Are you sure you want to delete this item?");
     var MSG_CONFIRM_ADD_ITEM = _("Are you sure you want to add a new item? Any changes made on this page will be lost.");
     var MSG_CONFIRM_SAVE = _("Are you sure you want to save?");
-    var columns_settings = [% TablesSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) | $raw %];
+    var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'additem', 'itemst', 'json' ) | $raw %];
 </script>
 <!-- / str/cataloging_additem.inc -->
diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js
index cb841c3e3c1..0f9311b06ff 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js
@@ -42,14 +42,14 @@ $(document).ready(function(){
     });
 
     // Skip the first column
-    columns_settings.unshift( { cannot_be_toggled: "1" } );
+    table_settings['columns'].unshift( { cannot_be_toggled: "1" } );
 
     var itemst = KohaTable("itemst", {
         'bPaginate': false,
         'bInfo': false,
         "bAutoWidth": false,
         "bKohaColumnsUseNames": true
-    }, columns_settings);
+    }, table_settings);
 
     var multiCopyControl = $("#add_multiple_copies_span");
     var addMultipleBlock = $("#addmultiple");
-- 
2.25.1