From: Sven Schöling Date: Wed, 11 Jun 2014 15:47:50 +0000 (+0200) Subject: RecordLinks: frühzeitig abbrechen, wenn keine links gefunden wurden. X-Git-Tag: release-3.2.0beta~411^2~66 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1c14fb86cf1b40ea0a91701d62a1a77b3146026c;p=kivitendo-erp.git RecordLinks: frühzeitig abbrechen, wenn keine links gefunden wurden. --- diff --git a/SL/DB/Helper/LinkedRecords.pm b/SL/DB/Helper/LinkedRecords.pm index cca9fe3c1..182f3bdcc 100644 --- a/SL/DB/Helper/LinkedRecords.pm +++ b/SL/DB/Helper/LinkedRecords.pm @@ -148,6 +148,9 @@ sub _linked_records_implementation { ORDER BY ${wanted}_table, ${wanted}_id, depth ASC; my $links = selectall_hashref_query($::form, $::form->get_standard_dbh, $query, $self->id, $self->meta->table); + + return [] unless @$links; + my $link_objs = SL::DB::Manager::RecordLink->get_all(query => [ id => [ map { $_->{id} } @$links ] ]); my @objects = map { $get_objects->($_) } @$link_objs;