From: Moritz Bunkus Date: Wed, 28 Jan 2015 15:02:44 +0000 (+0100) Subject: Pflichtenhefte: benutzerdefinierte Variablen bei Version reverten kopieren X-Git-Tag: release-3.2.1~51^2~15 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8b9174e8b54e8fda3bd8acdb6689d6ce900b32a6;p=kivitendo-erp.git Pflichtenhefte: benutzerdefinierte Variablen bei Version reverten kopieren --- 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;