X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4f7837d76dff9243196ac8fb3c4099215e32c514..c5daa6b42504dbe595de89e23fb83b9862c0ba6d:/SL/DB/Helper/LinkedRecords.pm diff --git a/SL/DB/Helper/LinkedRecords.pm b/SL/DB/Helper/LinkedRecords.pm index b75597abb..cca9fe3c1 100644 --- a/SL/DB/Helper/LinkedRecords.pm +++ b/SL/DB/Helper/LinkedRecords.pm @@ -154,8 +154,11 @@ sub _linked_records_implementation { if ($params{save_path}) { my %links_by_id = map { $_->{id} => $_ } @$links; for (@objects) { - $_->{_record_link_path} = $links_by_id{$_->{_record_link}->id}->{path}; - $_->{_record_link_depth} = $links_by_id{$_->{_record_link}->id}->{depth}; + my $link = $links_by_id{$_->{_record_link}->id}; + my $intermediate_links = SL::DB::Manager::RecordLink->get_all(query => [ id => $link->{path} ]); + $_->{_record_link_path} = $link->{path}; + $_->{_record_link_obj_path} = [ map { $get_objects->($_) } @$intermediate_links ]; + $_->{_record_link_depth} = $link->{depth}; } }