Bug 4941 - Remove singleBranchMode system preference
Summary: Remove singleBranchMode system preference
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
: 5053 7156 7314 (view as bug list)
Depends on: 15294 15295
Blocks: 17277
  Show dependency treegraph
 
Reported: 2010-07-05 16:40 UTC by Jared Camins
Modified: 2017-07-12 12:29 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
The singleBranchMode system preference has been removed. Koha instance with multiple libraries will not longer be able to use single branch mode. Single branch mode will be automatically enabled for Koha instances with only one library configured.
Version(s) released in:


Attachments
Bug 4941: Make tests non DB dependent (4.04 KB, patch)
2016-01-06 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 4941: DB Changes (1.37 KB, patch)
2016-01-06 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 4941: Remove the singleBranchMode system preference (7.75 KB, patch)
2016-01-06 10:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 4941: Make tests non DB dependent (4.10 KB, patch)
2016-01-17 02:46 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 4941: DB Changes (1.47 KB, patch)
2016-01-17 02:47 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 4941: Remove the singleBranchMode system preference (8.04 KB, patch)
2016-01-17 02:48 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 4941: Make tests non DB dependent (4.15 KB, patch)
2016-01-22 16:54 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941: Make tests non DB dependent (4.15 KB, patch)
2016-01-22 16:54 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4940: DB Changes (1.53 KB, patch)
2016-01-22 16:56 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941: Remove the singleBranchMode system preference (8.09 KB, patch)
2016-01-22 16:56 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941: Make tests non DB dependent (4.19 KB, patch)
2016-02-26 12:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941: Make tests non DB dependent (4.19 KB, patch)
2016-02-26 12:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4940: DB Changes (1.53 KB, patch)
2016-02-26 12:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941: Remove the singleBranchMode system preference (8.09 KB, patch)
2016-02-26 12:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 4941 [QA Followup] - Retain singleBranchMode in list of sysprefs passed to XSLT (1.14 KB, patch)
2016-02-26 12:25 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins 2010-07-05 16:40:40 UTC
Although the description of the syspref singleBranchMode implies that singleBranchMode is only relevant to the OPAC, in fact superlibrarians cannot change their branch on the staff client when it is set. Either the description of the syspref should be modified, or the syspref should be split into two, one that only impacts the OPAC, and one that only impacts the staff client.
Comment 1 Ian Walls 2011-07-21 11:55:07 UTC
I would contest that we shouldn't HAVE a singleBranchMode system preference.  Rather, if only one branch is configured in the system, Koha should detect that, and not offer branch selection options.
Comment 2 Paul Poulain 2011-07-21 12:15:12 UTC
I agree with Ian : SingleBranch is here to hide branch lists for the case of a single branch library (the list is useless)
So, it shouldn't be here, and should just be detected through the number of lines in branches table.

Having SingleBranch mode set and more than one branch sounds strange to me.
Comment 3 Paul Poulain 2011-08-02 15:58:48 UTC
*** Bug 5053 has been marked as a duplicate of this bug. ***
Comment 4 Owen Leonard 2013-03-26 15:29:16 UTC
This bug is still present in master as of 3.12 beta1. Although you can choose any branch when you're logging in, you can't change your library without logging out and logging in again. singleBranchMode blocks the form from appearing on the set library page.
Comment 5 Owen Leonard 2014-07-11 18:17:26 UTC
*** Bug 7156 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Druart 2015-03-25 11:37:05 UTC
(In reply to Paul Poulain from comment #2)
> Having SingleBranch mode set and more than one branch sounds strange to me.

Same here, what's the point of having this pref enabled if you have more than 1 branch?

(In reply to Ian Walls from comment #1)
> I would contest that we shouldn't HAVE a singleBranchMode system preference.
> Rather, if only one branch is configured in the system, Koha should detect
> that, and not offer branch selection options.

What about this idea? singleBranchMode could be set in Auth.pm and sent to templates.
Comment 7 Katrin Fischer 2015-03-25 11:40:54 UTC
Looking at the pref or doing a count of the branches in Auth.pm? Trying to understand :)
Comment 8 Jonathan Druart 2015-03-25 11:45:39 UTC
(In reply to Katrin Fischer from comment #7)
> Looking at the pref or doing a count of the branches in Auth.pm? Trying to
> understand :)

Count the branches from Auth and remove the pref everywhere.
$template->param( singleBranchMode => Koha::Branches->search->count );
Comment 9 Katrin Fischer 2015-03-25 12:38:01 UTC
Sounds good to me :)
Comment 10 Marc Véron 2016-01-05 15:49:36 UTC
(In reply to Jonathan Druart from comment #8)
> (In reply to Katrin Fischer from comment #7)
> > Looking at the pref or doing a count of the branches in Auth.pm? Trying to
> > understand :)
> 
> Count the branches from Auth and remove the pref everywhere.
> $template->param( singleBranchMode => Koha::Branches->search->count );

Yes, that makes sense.
Comment 11 Jonathan Druart 2016-01-06 10:48:55 UTC Comment hidden (obsolete)
Comment 12 Jonathan Druart 2016-01-06 10:48:59 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2016-01-06 10:49:02 UTC Comment hidden (obsolete)
Comment 14 Bernardo Gonzalez Kriegel 2016-01-06 11:08:27 UTC
Current master, on top of 15294, patch does not apply

Applying: Bug 4941: Remove the singleBranchMode system preference
fatal: sha1 information is lacking or useless (C4/Auth.pm).
Repository lacks necessary blobs to fall back on 3-way merge.
Comment 15 Jonathan Druart 2016-01-06 11:33:35 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #14)
> Current master, on top of 15294, patch does not apply

Sorry, depends on bug 15295 too.
Comment 16 Jonathan Druart 2016-01-06 13:26:50 UTC
*** Bug 7314 has been marked as a duplicate of this bug. ***
Comment 17 Chris Cormack 2016-01-17 02:46:26 UTC Comment hidden (obsolete)
Comment 18 Chris Cormack 2016-01-17 02:47:49 UTC Comment hidden (obsolete)
Comment 19 Chris Cormack 2016-01-17 02:48:12 UTC Comment hidden (obsolete)
Comment 20 Kyle M Hall 2016-01-22 16:54:31 UTC Comment hidden (obsolete)
Comment 21 Kyle M Hall 2016-01-22 16:54:53 UTC Comment hidden (obsolete)
Comment 22 Kyle M Hall 2016-01-22 16:56:30 UTC Comment hidden (obsolete)
Comment 23 Kyle M Hall 2016-01-22 16:56:37 UTC Comment hidden (obsolete)
Comment 24 Kyle M Hall 2016-02-26 12:25:02 UTC Comment hidden (obsolete)
Comment 25 Kyle M Hall 2016-02-26 12:25:22 UTC
Created attachment 48395 [details] [review]
Bug 4941: Make tests non DB dependent

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 26 Kyle M Hall 2016-02-26 12:25:29 UTC
Created attachment 48396 [details] [review]
Bug 4940: DB Changes

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

http://bugs.koha-community.org/show_bug.cgi?id=4941

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 27 Kyle M Hall 2016-02-26 12:25:32 UTC
Created attachment 48397 [details] [review]
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>
Comment 28 Kyle M Hall 2016-02-26 12:25:35 UTC
Created attachment 48398 [details] [review]
Bug 4941 [QA Followup] - Retain singleBranchMode in list of sysprefs passed to XSLT
Comment 29 Kyle M Hall 2016-02-26 12:36:20 UTC
Pushed to master, thanks Jonathan! Should be in the Koha 3.24 release!