From: D Ruth Bavousett Date: Fri, 16 Dec 2011 15:38:47 +0000 (-0500) Subject: Bug 7364: Possible to get to FA item add without current branch being defined. X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=4cf7cd28dab9485d89ecfe06660f98b2cd374243;p=koha.git 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 Modified for syntax by: Ian Walls Signed-off-by: Ian Walls --- diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index a734d0fefe..d22558fb41 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -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