]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/CsvImport/Base.pm
CsvImport: handle_cvars: CVars für das zu speichernde Objekt setzen.
[mfinanz.git] / SL / Controller / CsvImport / Base.pm
index 663be5eb8b8e7beb1ebf78b51578e3f315c307a7..4d7df747ada36c18ae8607da3882513d7660b840 100644 (file)
@@ -311,14 +311,15 @@ sub handle_cvars {
 
   # merge existing with new cvars. swap every existing with the imported one, push the rest
   if (@cvars) {
-    my @orig_cvars = ($entry->{object_to_save} || $entry->{object})->custom_variables;
+    my $object     = $entry->{object_to_save} || $entry->{object};
+    my @orig_cvars = $object->custom_variables;
     for (@orig_cvars) {
       $_ = $changed_cvars{ $_->config->name } if $changed_cvars{ $_->config->name };
       delete $changed_cvars{ $_->config->name };
     }
     push @orig_cvars, values %changed_cvars;
 
-    $entry->{object}->custom_variables(\@orig_cvars);
+    $object->custom_variables(\@orig_cvars);
   }
 }