From a7f02ca024d1fb4154c31381600081f7a7bf4039 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 29 Jan 2018 17:54:11 +0100 Subject: [PATCH] CsvImport: Makemodels bei bestehenden Waren stabil sortieren --- SL/Controller/CsvImport/Part.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index d337550b0..f04e7d632 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -667,7 +667,7 @@ sub handle_makemodel { my %old_makemodels_by_mm = map { $_->make . $; . $_->model => $_ } $entry->{part}->makemodels; my @new_makemodels; - foreach my $makemodel ($object->makemodels()) { + foreach my $makemodel (@{ $object->makemodels_sorted }) { my $makemodel_orig = $old_makemodels_by_mm{$makemodel->make,$makemodel->model}; $found_any = 1; @@ -680,11 +680,11 @@ sub handle_makemodel { } } - $entry->{part}->makemodels([ $entry->{part}->makemodels, @new_makemodels ]) if @new_makemodels; + $entry->{part}->makemodels([ $entry->{part}->makemodels_sorted, @new_makemodels ]) if @new_makemodels; # reindex makemodels my $i = 0; - $_->sortorder(++$i) for @{ $entry->{part}->makemodels }; + $_->sortorder(++$i) for @{ $entry->{part}->makemodels_sorted }; $self->save_with_cascade(1) if $found_any; } -- 2.20.1