Bug 17829: (follow-up) Move GetMember to Koha::Patron
Prevent crash at the opac when no user is logged in Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
fd28b02202
commit
c91eb80efb
3 changed files with 4 additions and 4 deletions
|
@ -174,7 +174,7 @@ for my $itm (@items) {
|
||||||
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
|
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
|
||||||
&& $itm->{'itemnumber'};
|
&& $itm->{'itemnumber'};
|
||||||
|
|
||||||
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed($itm, $patron->unblessed)
|
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, ( $patron ? $patron->unblessed : {} ) )
|
||||||
unless $allow_onshelf_holds;
|
unless $allow_onshelf_holds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,9 +127,9 @@ if(my $cart_list = $query->cookie("bib_list")){
|
||||||
}
|
}
|
||||||
|
|
||||||
my $allow_onshelf_holds;
|
my $allow_onshelf_holds;
|
||||||
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
|
my $patron = Koha::Patrons->find( $loggedinuser );
|
||||||
for my $itm (@all_items) {
|
for my $itm (@all_items) {
|
||||||
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed($itm, $patron);
|
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, ( $patron ? $patron->unblessed : {} ) );
|
||||||
last if $allow_onshelf_holds;
|
last if $allow_onshelf_holds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -668,7 +668,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) {
|
||||||
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
|
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
|
||||||
&& $itm->{'itemnumber'};
|
&& $itm->{'itemnumber'};
|
||||||
|
|
||||||
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, $patron->unblessed )
|
$allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, ( $patron ? $patron->unblessed : {} ) )
|
||||||
unless $allow_onshelf_holds;
|
unless $allow_onshelf_holds;
|
||||||
|
|
||||||
# get collection code description, too
|
# get collection code description, too
|
||||||
|
|
Loading…
Reference in a new issue