Pflichtenhefte: Fehler beim Anlegen von Versionen richtig abfangen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 28 Jan 2015 14:42:58 +0000 (15:42 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 19 Feb 2015 09:43:01 +0000 (10:43 +0100)
SL/Controller/RequirementSpecVersion.pm

index eab34d6..e97d225 100644 (file)
@@ -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 });