Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use C4::Context; |
3 |
|
4 |
my $dbh = C4::Context->dbh; |
5 |
|
6 |
my ( $db_value ) = $dbh->selectrow_array(q|SELECT count(*) FROM branches|); |
7 |
my $pref_value = C4::Context->preference("singleBranchMode") || 0; |
8 |
if ( $db_value > 1 and $pref_value == 1 ) { |
9 |
warn "WARNING: You have more than 1 libraries in your branches tables but the singleBranchMode system preference is on.\n"; |
10 |
warn "This configuration does not make sense. The system preference is going to be deleted,\n"; |
11 |
warn "and this parameter will be based on the number of libraries defined.\n"; |
12 |
} |
13 |
$dbh->do(q|DELETE FROM systempreferences WHERE variable="singleBranchMode"|); |