View | Details | Raw Unified | Return to bug 41663
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_41663.pl (-1 / +32 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "41663",
6
    description => "Change default values for 'ILLHistoryCheck',
7
        'ILLOpacUnauthenticatedRequest','SeparateHoldingsByGroup' and 'RequireChoosingExistingAuthority' sysprefs",
8
    up => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        my @sysprefs = qw(ILLHistoryCheck ILLOpacUnauthenticatedRequest SeparateHoldingsByGroup);
13
14
        for my $syspref (@sysprefs) {
15
            $dbh->do(
16
                "UPDATE systempreferences SET value = 0 WHERE variable = ?",
17
                undef,
18
                $syspref
19
            );
20
            say $out "Updated system preference default value for '$syspref'";
21
        }
22
23
        $dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'RequireChoosingExistingAuthority'");
24
        say $out "Updated system preference default value for 'RequireChoosingExistingAuthority'";
25
26
        say_success(
27
            $out,
28
            "Updated system preferences ILLHistoryCheck, ILLOpacUnauthenticatedRequest, SeparateHoldingsByGroup and RequireChoosingExistingAuthority"
29
        );
30
31
    },
32
};

Return to bug 41663