From 885cf37d292ae87e9eb862af439aa9466e230cad Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Thu, 8 Feb 2024 17:56:01 +0100 Subject: [PATCH] FirmendatenSet -> AddNeuenFirmendatenWert --- www/lib/class.erpapi.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index 77825e1b..e4b2f536 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -26081,7 +26081,14 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p } } else { - $this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'"); + + $column_exists = $this->app->DB->Select("SHOW COLUMNS FROM firmendaten WHERE field = '".$field."'"); + + if ($column_exists) { + $this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'"); + } else { + $this->AddNeuenFirmendatenWert($field, $typ, $typ1, $typ2, $value, $default_value, $default_null, $darf_null); + } } $db = $this->app->Conf->WFdbname; if(!empty($this->firmendaten[$db])) {