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

(-)a/installer/data/mysql/atomicupdate/bug_33297.pl (-1 / +25 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
3
return {
4
    bug_number => "33297",
5
    description => "Fix missing 's' in system preference 'RetainPatronSearchTerms'",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Correct preference may have been generated via interface
10
        my ($correct_syspref_exists) = $dbh->selectrow_array(q{
11
            SELECT COUNT(*) FROM systempreferences WHERE variable='RetainPatronsSearchTerms'
12
        });
13
        if ($correct_syspref_exists) {
14
            $dbh->do(q{
15
                DELETE FROM systempreferences WHERE variable='RetainPatronSearchTerms'
16
            });
17
            say $out "Wrong system preference 'RetainPatronSearchTerms' deleted";
18
        } else {
19
            $dbh->do(q{
20
                UPDATE systempreferences SET variable='RetainPatronsSearchTerms' WHERE variable='RetainPatronSearchTerms'
21
            });
22
            say $out "Wrong system preference 'RetainPatronSearchTerms' renamed 'RetainPatronsSearchTerms'";
23
        }
24
    },
25
};

Return to bug 33297