Bug 7364: Possible to get to FA item add without current branch being defined.

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>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
D Ruth Bavousett 2011-12-16 10:38:47 -05:00 committed by Paul Poulain
parent c13d3f0043
commit 6f681bec2d

View file

@ -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