use Modern::Perl;
use List::Util qw( first );
-use YAML;
+use YAML::XS;
use C4::Context;
use Koha::Database;
use Koha::Caches;
my $yaml = $cache->get_from_cache('TablesSettingsYaml');
unless ($yaml) {
- $yaml = eval { YAML::LoadFile($yml_path) };
+ $yaml = eval { YAML::XS::LoadFile($yml_path) };
warn "ERROR: the yaml file for DT::TablesSettings is not correctly formatted: $@"
if $@;
$cache->set_in_cache( 'TablesSettingsYaml', $yaml, { expiry => 3600 } );
return $columns;
}
+=head3 get_table_settings
+
+my $settings = C4::Utils::DataTables::TablesSettings::get_table_settings(
+ {
+ module => $module,
+ pag => $page,
+ tablename => $tablename,
+ }
+);
+
+Returns the settings for a given table.
+
+The settings are default_display_length and default_sort_order.
+
+=cut
+
sub get_table_settings {
my ( $module, $page, $tablename ) = @_;
my $list = get_yaml;