Bug 4941: Remove the singleBranchMode system preference
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Jan 2016 10:41:44 +0000 (10:41 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 26 Feb 2016 12:13:09 +0000 (12:13 +0000)
commit8627ec5f6a274e46940bb82c52341e012fc6406d
tree23ac1f84455095dec044f1e3e93a5943a8feabc9
parent9909ef66ef627937c3235261907104abeb504e30
Bug 4941: Remove the singleBranchMode system preference

The singleBranchMode system preference does not make sense.
Either the install has only 1 library defined or several. In both case,
we can easily guess the behavior to follow.

So the idea of this patch is to replace the fetch of this syspref with a
call to count the number of libraries defined in DB.

Test plan:
1/ From a fresh Koha install, execute the DB entry to remove the pref.
2/ Define only 1 library
3/ Confirm that Koha behaves the same as before (try to change your
library, look at the facets)
4/ Create another library (or more) and reinsert the pref and set it:
  insert into systempreferences (variable, value)
    values('singleBranchMode', 1);
5/ Execute the DB entry
You should get a warning message.
6/ Repeat 3.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Does what it says, but will change behaviour for any Koha install that
has 2 branches defined, One circulation, and this preference set.
If that is an acceptable change, we might need to make sure this is noted well in the
release notes.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Auth.pm
C4/Koha.pm
C4/Search.pm
C4/UsageStats.pm
C4/XSLT.pm
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
opac/opac-reserve.pl