From 78912e55533a48109adc11e798101b29e174728d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 23 Jan 2015 16:17:18 +0100 Subject: [PATCH] =?utf8?q?Konditional=20RecordLink=20save=20aufrufen=20(an?= =?utf8?q?alog=20zu=20ar=20auch=20f=C3=BCr=20oe)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IR.pm | 18 ++++++++++-------- SL/IS.pm | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/SL/IR.pm b/SL/IR.pm index 457c48162..0dd0ee8b2 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -757,14 +757,16 @@ SQL Common::webdav_folder($form); # Link this record to the records it was created from. - RecordLinks->create_links('dbh' => $dbh, - 'mode' => 'ids', - 'from_table' => 'oe', - 'from_ids' => $form->{convert_from_oe_ids}, - 'to_table' => 'ap', - 'to_id' => $form->{id}, - ); - delete $form->{convert_from_oe_ids}; + if ($form->{convert_from_oe_ids}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => $form->{convert_from_oe_ids}, + 'to_table' => 'ap', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_oe_ids}; + } my @convert_from_do_ids = map { $_ * 1 } grep { $_ } split m/\s+/, $form->{convert_from_do_ids}; if (scalar @convert_from_do_ids) { diff --git a/SL/IS.pm b/SL/IS.pm index e2358ea16..0d3cdf0bd 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1215,14 +1215,16 @@ SQL } # Link this record to the records it was created from. - RecordLinks->create_links('dbh' => $dbh, - 'mode' => 'ids', - 'from_table' => 'oe', - 'from_ids' => $form->{convert_from_oe_ids}, - 'to_table' => 'ar', - 'to_id' => $form->{id}, - ); - delete $form->{convert_from_oe_ids}; + if ($form->{convert_from_oe_ids}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => $form->{convert_from_oe_ids}, + 'to_table' => 'ar', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_oe_ids}; + } my @convert_from_do_ids = map { $_ * 1 } grep { $_ } split m/\s+/, $form->{convert_from_do_ids}; -- 2.20.1