Browse Source

Bug 20310: (follow-up) Check if biblio exists; 755 host_record.t

In order to prevent an error like:
Can't call method "host_record" on an undefined value at opac/opac-request-article.pl

Also chmod's host_record.t to 755 (File must have the exec flag)

Test plan:
Change the URL so that the biblionumber does not exist.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
master
Marcel de Rooy 6 months ago
committed by Jonathan Druart
parent
commit
cc316db0b1
  1. 4
      opac/opac-request-article.pl
  2. 0
      t/db_dependent/Koha/Biblio/host_record.t

4
opac/opac-request-article.pl

@ -40,6 +40,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $action = $cgi->param('action') || q{};
my $biblionumber = $cgi->param('biblionumber');
my $biblio = Koha::Biblios->find($biblionumber);
if( !$biblio ) {
print $cgi->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
if ( $action eq 'create' ) {
my $branchcode = $cgi->param('branchcode');

0
t/db_dependent/Koha/Biblio/host_record.t

Loading…
Cancel
Save