Koha/installer/data/mysql/atomicupdate/bug_29648.pl
Jonathan Druart 2be3e07970 Bug 29648: Move NumSavedReports to the table settings
The syspref NumSavedReports can be moved to the table settings config
Test plan:
1. Set the syspref to a given value
2. updatedatabase # execute the atomic update
3. Go to the table settings page and confirm that the syspref's value
has been retrieved
4. Select a specific colonne for the default sort
5. Go to the report list view and confirm that the "Show X entries" has
the correct selected value and that the table is sorted as you expect.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-27 11:20:43 -10:00

23 lines
708 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "29648",
description => "Move NumSavedReports to table settings",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my $NumSavedReports = C4::Context->preference('NumSavedReports');
$dbh->do(q{
DELETE FROM systempreferences
WHERE variable="NumSavedReports"
});
if ( $NumSavedReports ) {
$dbh->do(q{
INSERT IGNORE INTO tables_settings (module, page, tablename, default_display_length, default_sort_order)
VALUES('reports', 'saved-sql', 'table_reports', ?, 1)
}, undef, $NumSavedReports);
}
},
}