Bug 20763: Remove unecessary Koha::Patron fetch
If $borrowernumber is not set, there is no userenv. So let's pick the library code set in the userenv instead of fetching the Koha::Patron->branchcode from DB Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
e3cc49a61b
commit
7e025fde1a
|
|
@ -198,12 +198,7 @@ my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
|
|||
if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) {
|
||||
my $branchcode = $input->param('branchcode') || q{};
|
||||
|
||||
if ( !$branchcode && $borrowernumber ) {
|
||||
my $patron = Koha::Patrons->find($borrowernumber);
|
||||
$branchcode = $patron->branchcode;
|
||||
}
|
||||
|
||||
if ( !$branchcode
|
||||
if ( !$branchcode
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{branch} )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue