From 1f024d692e4c03fca4747a9a224ef8587c6b9819 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 28 Jan 2015 15:42:58 +0100 Subject: [PATCH] Pflichtenhefte: Fehler beim Anlegen von Versionen richtig abfangen --- SL/Controller/RequirementSpecVersion.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/Controller/RequirementSpecVersion.pm b/SL/Controller/RequirementSpecVersion.pm index eab34d64e..e97d2252b 100644 --- a/SL/Controller/RequirementSpecVersion.pm +++ b/SL/Controller/RequirementSpecVersion.pm @@ -72,13 +72,14 @@ sub action_create { return $self->js->error(@errors)->render($self) if @errors; my $db = $self->requirement_spec->db; - my @result = $self->version($self->requirement_spec->create_version(%attributes)); + my @result = $self->requirement_spec->create_version(%attributes); if (!@result) { $::lxdebug->message(LXDebug::WARN(), "Error: " . $db->error); return $self->js->error($::locale->text('Saving failed. Error message from the database: #1'), $db->error)->render($self); } + $self->version($result[0]); my $version_info_html = $self->render('requirement_spec/_version', { output => 0 }, requirement_spec => $self->requirement_spec); my $version_list_html = $self->render('requirement_spec_version/list', { output => 0 }); -- 2.20.1