Bug 24156: Fix some QA failures

* Add POD to get_table_settings
* Remove USE Dumper debug statement
* Add missing "10" entry
* Fix newly created test file (and renamed)

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2020-06-23 11:29:05 +02:00
parent 8bda9ce467
commit 2201edfe6e
3 changed files with 19 additions and 3 deletions

View File

@ -59,6 +59,22 @@ sub get_columns {
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;

View File

@ -3,7 +3,6 @@
[% USE TablesSettings %]
[% SET footerjs = 1 %]
[% SET panel_id = 0 %]
[% USE Dumper %]
[% BLOCK pagelist %]
[% IF module.keys and module.keys.size > 0 %]
Jump to:
@ -101,6 +100,7 @@
[% IF table_settings.default_display_length == 10 %]
<option value="10" selected="selected">10</option>
[% ELSE %]
<option value="10">10</option>
[% END %]
[% IF table_settings.default_display_length == 20 %]
<option value="20" selected="selected">20</option>

View File

@ -10,10 +10,10 @@ use Test::More tests => 3;
use t::lib::Mocks;
BEGIN {
use_ok('Koha::Template::Plugin::ColumnsSettings', "Can use Koha::Template::Plugin::ColumnsSettings");
use_ok('Koha::Template::Plugin::TablesSettings', "Can use Koha::Template::Plugin::TablesSettings");
}
ok( my $settings = Koha::Template::Plugin::ColumnsSettings->new(), 'Able to instantiate template plugin' );
ok( my $settings = Koha::Template::Plugin::TablesSettings->new(), 'Able to instantiate template plugin' );
subtest "is_hidden" => sub {
plan tests => 2;