Skip to content

Commit

Permalink
Bug 17829: (follow-up) Move GetMember to Koha::Patron
Browse files Browse the repository at this point in the history
Prevent crash at the opac when no user is logged in

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
  • Loading branch information
joubu committed Jul 11, 2017
1 parent fd28b02 commit c91eb80
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion opac/opac-ISBDdetail.pl
Expand Up @@ -174,7 +174,7 @@ =head1 FUNCTIONS
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
&& $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;
}

Expand Down
4 changes: 2 additions & 2 deletions opac/opac-MARCdetail.pl
Expand Up @@ -127,9 +127,9 @@ =head1 DESCRIPTION
}

my $allow_onshelf_holds;
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
my $patron = Koha::Patrons->find( $loggedinuser );
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;
}

Expand Down
2 changes: 1 addition & 1 deletion opac/opac-detail.pl
Expand Up @@ -668,7 +668,7 @@ BEGIN
&& !$itemtypes->{$itm->{'itype'}}->{notforloan}
&& $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;

# get collection code description, too
Expand Down

0 comments on commit c91eb80

Please sign in to comment.