Revision ac84b678
Von Bernd Bleßmann vor etwa 7 Jahren hinzugefügt
SL/Controller/CsvImport/Base.pm | ||
---|---|---|
313 | 313 |
|
314 | 314 |
# merge existing with new cvars. swap every existing with the imported one, push the rest |
315 | 315 |
if (@cvars) { |
316 |
my @orig_cvars = ($entry->{object_to_save} || $entry->{object})->custom_variables; |
|
316 |
my $object = $entry->{object_to_save} || $entry->{object}; |
|
317 |
my @orig_cvars = $object->custom_variables; |
|
317 | 318 |
for (@orig_cvars) { |
318 | 319 |
$_ = $changed_cvars{ $_->config->name } if $changed_cvars{ $_->config->name }; |
319 | 320 |
delete $changed_cvars{ $_->config->name }; |
320 | 321 |
} |
321 | 322 |
push @orig_cvars, values %changed_cvars; |
322 | 323 |
|
323 |
$entry->{object}->custom_variables(\@orig_cvars);
|
|
324 |
$object->custom_variables(\@orig_cvars);
|
|
324 | 325 |
} |
325 | 326 |
} |
326 | 327 |
|
Auch abrufbar als: Unified diff
CsvImport: handle_cvars: CVars für das zu speichernde Objekt setzen.