From 8b9174e8b54e8fda3bd8acdb6689d6ce900b32a6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 28 Jan 2015 16:02:44 +0100 Subject: [PATCH] Pflichtenhefte: benutzerdefinierte Variablen bei Version reverten kopieren --- SL/DB/RequirementSpec.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SL/DB/RequirementSpec.pm b/SL/DB/RequirementSpec.pm index bad980387..1cc17712f 100644 --- a/SL/DB/RequirementSpec.pm +++ b/SL/DB/RequirementSpec.pm @@ -175,6 +175,11 @@ sub _copy_from { %attributes); } + # Copy custom variables. + foreach my $var (@{ $source->cvars_by_config }) { + $self->cvar_by_name($var->config->name)->value($var->value); + } + my %paste_template_result; # Clone text blocks and pictures. @@ -207,7 +212,7 @@ sub _copy_from { $self->$accessor($paste_template_result{parts}); # Save new object -- we need its ID for the items. - $self->save; + $self->save(cascade => 1); my %id_to_clone; -- 2.20.1