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:
parent
072a901d35
commit
55f56c09dd
|
|
@ -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 ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue