|
Lines 8-31
return {
Link Here
|
| 8 |
my ($args) = @_; |
8 |
my ($args) = @_; |
| 9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
| 10 |
|
10 |
|
| 11 |
# Check if the preference exists before removing |
11 |
$dbh->do( |
| 12 |
my ($exists) = $dbh->selectrow_array( |
|
|
| 13 |
q{ |
12 |
q{ |
| 14 |
SELECT COUNT(*) |
13 |
DELETE FROM systempreferences |
| 15 |
FROM systempreferences |
|
|
| 16 |
WHERE variable = 'SeparateHoldingsByGroup' |
14 |
WHERE variable = 'SeparateHoldingsByGroup' |
| 17 |
} |
15 |
} |
| 18 |
); |
16 |
) != '0E0' && say_success( $out, "Removed system preference 'SeparateHoldingsByGroup'" ); |
| 19 |
|
|
|
| 20 |
if ($exists) { |
| 21 |
$dbh->do( |
| 22 |
q{ |
| 23 |
DELETE FROM systempreferences |
| 24 |
WHERE variable = 'SeparateHoldingsByGroup' |
| 25 |
} |
| 26 |
); |
| 27 |
} |
| 28 |
|
| 29 |
say_success( $out, "Removed system preference 'SeparateHoldingsByGroup'" ); |
| 30 |
}, |
17 |
}, |
| 31 |
}; |
18 |
}; |
| 32 |
- |
|
|