Bug 7364: Possible to get to FA item add without current branch being defined.
authorD Ruth Bavousett <ruth@bywatersolutions.com>
Fri, 16 Dec 2011 15:38:47 +0000 (10:38 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 17 Jan 2012 08:32:39 +0000 (09:32 +0100)
Some paths to the FA item-add screen didn't have a branch defined--if the param is set,
use it, otherwise, use the user's logged in branch.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Modified for syntax by:  Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
cataloguing/additem.pl

index a734d0f..d22558f 100755 (executable)
@@ -665,10 +665,7 @@ my $onlymine = C4::Context->preference('IndependantBranches') &&
                C4::Context->userenv                           && 
                C4::Context->userenv->{flags}!=1               && 
                C4::Context->userenv->{branch};
-my $branch = C4::Context->userenv->{branch};
-if ($frameworkcode eq 'FA'){
-    $branch = $input->param('branch');
-}    
+my $branch = $input->param('branch') || C4::Context->userenv->{branch};
 my $branches = GetBranchesLoop($branch,$onlymine);  # build once ahead of time, instead of multiple times later.
 
 # We generate form, from actuel record