Hi,
v2024.16
exports are not being logged due to error:
An exception occurred while executing a query: Field ‘Filename’ doesn’t have a default value
at Exportlog.php | insert($rs)
INSERT INTO exportlog (`FileId`, `DateTime`, `User`, `ExportType`, `Table`, `KeyValue`, `Request`) VALUES(?, ?, ?, ?, ?, ?, ?)
params:
$rsnew @ function WriteExportLog($fileId, $dt, $usr, $exportType, $table, $keyValue, $fileName, $req)
appears the fieldname variable is missing in the insert statement, looks like this is missing:
"EXPORT_LOG_FIELD_NAME_FILENAME_ALIAS" => "filename", // File name field name Alias
WriteExportLog() $rsnew should be:
$rsnew = [
Config("EXPORT_LOG_FIELD_NAME_FILE_ID") => $fileId,
Config("EXPORT_LOG_FIELD_NAME_DATETIME") => $dt,
Config("EXPORT_LOG_FIELD_NAME_USER") => $usr,
Config("EXPORT_LOG_FIELD_NAME_EXPORT_TYPE") => $exportType,
Config("EXPORT_LOG_FIELD_NAME_TABLE") => $table,
Config("EXPORT_LOG_FIELD_NAME_KEY_VALUE") => $keyValue,
Config("EXPORT_LOG_FIELD_NAME_FILENAME") => $fileName,
**Config("EXPORT_LOG_FIELD_NAME_FILENAME_ALIAS") => $fileName,**
Config("EXPORT_LOG_FIELD_NAME_REQUEST") => $req
];
once added to the array, exports were being logged to the table.