From 32f83e8e1c88c04cd9a8686d8482b1473a9d73c5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 9 Jul 2013 15:00:18 +0200 Subject: [PATCH] Pflichtenhefte: Standard-Artikel beim Anlegen von Abschnitten speichern --- SL/Controller/RequirementSpecItem.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SL/Controller/RequirementSpecItem.pm b/SL/Controller/RequirementSpecItem.pm index 98e160ab8..2cbf11447 100644 --- a/SL/Controller/RequirementSpecItem.pm +++ b/SL/Controller/RequirementSpecItem.pm @@ -172,6 +172,10 @@ sub action_ajax_create { my $attributes = $::form->{$prefix} || die "Missing parameter group '${prefix}'"; my $insert_after = delete $attributes->{insert_after}; + if (!$attributes->{parent_id}) { + $attributes->{order_part_id} ||= $::instance_conf->get_requirement_spec_section_order_part_id; + } + my @errors = $self->item(SL::DB::RequirementSpecItem->new(%{ $attributes }))->validate; return $self->js->error(@errors)->render($self) if @errors; -- 2.20.1