From 77442185c794607d40197877896ae33cea1c511c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 11 May 2012 11:26:49 +0200 Subject: [PATCH] =?utf8?q?Bug=20in=20CT:=20SQL=20Fehler=20wenn=20es=20kein?= =?utf8?q?e=20Ansprechpartner=20gibt=20aber=20CVars=20f=C3=BCr=20Ansprechp?= =?utf8?q?artner=20angelegt=20wurden.=20gibt=20aber=20CVars=20f=C3=BCr=20A?= =?utf8?q?nsprechpartner=20angelegt=20wurden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/CT.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/SL/CT.pm b/SL/CT.pm index 888634894..49eb59154 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -448,12 +448,14 @@ sub save_customer { 'trans_id' => $form->{id}, 'variables' => $form, 'always_valid' => 1); - CVar->save_custom_variables('dbh' => $dbh, - 'module' => 'Contacts', - 'trans_id' => $form->{cp_id}, - 'variables' => $form, - 'name_prefix' => 'cp', - 'always_valid' => 1); + if ($form->{cp_id}) { + CVar->save_custom_variables('dbh' => $dbh, + 'module' => 'Contacts', + 'trans_id' => $form->{cp_id}, + 'variables' => $form, + 'name_prefix' => 'cp', + 'always_valid' => 1); + } my $rc = $dbh->commit(); @@ -663,12 +665,14 @@ sub save_vendor { 'trans_id' => $form->{id}, 'variables' => $form, 'always_valid' => 1); - CVar->save_custom_variables('dbh' => $dbh, - 'module' => 'Contacts', - 'trans_id' => $form->{cp_id}, - 'variables' => $form, - 'name_prefix' => 'cp', - 'always_valid' => 1); + if ($form->{cp_id}) { + CVar->save_custom_variables('dbh' => $dbh, + 'module' => 'Contacts', + 'trans_id' => $form->{cp_id}, + 'variables' => $form, + 'name_prefix' => 'cp', + 'always_valid' => 1); + } my $rc = $dbh->commit(); -- 2.20.1