X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/90f4ba5dc6212592754cdddd082640103ee15884..e8ac38a63f43c43b30cdf45bd877e39bf0fd41b1:/SL/Controller/RequirementSpecTextBlock.pm diff --git a/SL/Controller/RequirementSpecTextBlock.pm b/SL/Controller/RequirementSpecTextBlock.pm index eaf8b6fdc..c4f37de10 100644 --- a/SL/Controller/RequirementSpecTextBlock.pm +++ b/SL/Controller/RequirementSpecTextBlock.pm @@ -126,6 +126,7 @@ sub action_ajax_create { SL::ClientJS->new ->replaceWith('#' . $::form->{form_prefix} . '_form', $html) ->jstree->create_node('#tree', $insert_after ? ('#tb-' . $insert_after, 'after') : ('#tb-' . ($attributes->{output_position} == 0 ? 'front' : 'back'), 'last'), $node) + ->jstree->select_node('#tree', '#tb-' . $self->text_block->id) ->render($self); } @@ -273,7 +274,7 @@ sub output_position_from_id { return undef if $type !~ m/text-block/; } - my $text_block = SL::DB::Manager::RequirementSpecTextBlock->find_by(id => $id); + my $text_block = $id ? SL::DB::Manager::RequirementSpecTextBlock->find_by(id => $id) : undef; return $text_block ? $text_block->output_position : undef; }