Fehlermeldung bei 'als neu Speichern' bei Erzeugnissen ohne Erzeungisbestandteile...
authorJan Büren <jan@kivitendo.de>
Sun, 28 Oct 2018 11:28:51 +0000 (12:28 +0100)
committerJan Büren <jan@kivitendo.de>
Thu, 22 Nov 2018 12:34:38 +0000 (13:34 +0100)
SL/Controller/Part.pm

index 357a3dd..31c670a 100644 (file)
@@ -646,6 +646,8 @@ sub prepare_assortment_render_vars {
 sub prepare_assembly_render_vars {
   my ($self) = @_;
 
+  croak("Need assembly item(s) to create a 'save as new' assembly.") unless $self->part->items;
+
   my %vars = ( items_sellprice_sum => $self->part->items_sellprice_sum,
                items_lastcost_sum  => $self->part->items_lastcost_sum,
                assembly_html       => $self->render_assembly_items_to_html( \@{ $self->part->items } ),