Bug 15497: (RM follow-up) Fix for new itemtype case

When creating an entirely new itemtype the script would fail upon
attempting to lookup existing itemtype branch limits. This patch adds a
ternary to prevent the failure.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-09-13 07:51:53 +01:00
parent 072a901d35
commit 55f56c09dd
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ undef($sip_media_type) if defined($sip_media_type) and $sip_media_type =~ /^\s*$
if ( $op eq 'add_form' ) {
my $itemtype = Koha::ItemTypes->find($itemtype_code);
my $selected_branches = $itemtype->get_library_limits;
my $selected_branches = $itemtype ? $itemtype->get_library_limits : undef;
my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
my @branches_loop;
foreach my $branch ( @$branches ) {