Bug 22735: Resolve internal server error on missing item type

Trivial fix, similar to opac-detail, applied to ISBD and MARC detail.

Test plan:
Enable ArticleRequests pref.
Make sure you have a biblio with no item type in 942c. (Perhaps you need to
make 942c not mandatory temporarily and save a biblio record without this
field being filled.)
If you are logged in, log out.
Go to MARC or ISBD detail page. No crash anymore?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b78bd2faec)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b99fbdd8fc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2019-04-19 06:49:48 +00:00 committed by Lucas Gass
parent ce7cb18847
commit a2d45b1cb4
2 changed files with 20 additions and 0 deletions

View File

@ -217,4 +217,14 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$template->param('OPACSearchForTitleIn' => $search_for_title);
}
if( C4::Context->preference('ArticleRequests') ) {
my $itemtype = Koha::ItemTypes->find($biblio->itemtype);
my $artreqpossible = $patron
? $biblio->can_article_request( $patron )
: $itemtype
? $itemtype->may_article_request
: q{};
$template->param( artreqpossible => $artreqpossible );
}
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -349,6 +349,16 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$template->param('OPACSearchForTitleIn' => $search_for_title);
}
if( C4::Context->preference('ArticleRequests') ) {
my $itemtype = Koha::ItemTypes->find($biblio->itemtype);
my $artreqpossible = $patron
? $biblio->can_article_request( $patron )
: $itemtype
? $itemtype->may_article_request
: q{};
$template->param( artreqpossible => $artreqpossible );
}
$template->param(
item_loop => \@item_loop,
item_header_loop => \@item_header_loop,