Leere Strings (item_type = 0) nicht mehr in die DB schreiben

Kommentare korrigiert
This commit is contained in:
PitzM 2025-06-26 14:47:30 +02:00
parent 2e0ae13a77
commit 0ed996100d
2 changed files with 11 additions and 5 deletions

View File

@ -181,7 +181,7 @@ Public Class PropertyValues
Try Try
oPropertyValueList = GetPropValue(pDocument, oItem.Key) oPropertyValueList = GetPropValue(pDocument, oItem.Key)
Catch ex As Exception Catch ex As Exception
_logger.Warn("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oPropertyDescription, oItem.Value.GroupScope, MessageId) _logger.Warn("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oTableColumn, oItem.Value.GroupScope, MessageId)
_logger.Warn("ERROR-MESSAGE [{0}]", ex.Message) _logger.Warn("ERROR-MESSAGE [{0}]", ex.Message)
_logger.Error(ex) _logger.Error(ex)
oPropertyValueList = New List(Of Object) oPropertyValueList = New List(Of Object)
@ -200,20 +200,20 @@ Public Class PropertyValues
' This should hopefully show config errors ' This should hopefully show config errors
If TypeOf oPropertyValue Is List(Of Object) Then If TypeOf oPropertyValue Is List(Of Object) Then
_logger.Warn("Item with specification [{0}] may be configured incorrectly", oPropertyDescription) _logger.Warn("Item with specification [{0}] may be configured incorrectly", oTableColumn)
oPropertyValue = Nothing oPropertyValue = Nothing
End If End If
End Select End Select
End If End If
Catch ex As Exception Catch ex As Exception
_logger.Warn("Unknown error occurred while processing specification [{0}]:", oPropertyDescription) _logger.Warn("Unknown error occurred while processing specification [{0}]:", oTableColumn)
_logger.Error(ex) _logger.Error(ex)
oPropertyValue = Nothing oPropertyValue = Nothing
End Try End Try
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If oItem.Value.IsRequired Then If oItem.Value.IsRequired Then
_logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oPropertyDescription) _logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oTableColumn)
Dim oMissingProperty = New MissingProperty With Dim oMissingProperty = New MissingProperty With
{ {
.Description = oPropertyDescription, .Description = oPropertyDescription,
@ -222,7 +222,7 @@ Public Class PropertyValues
oResult.MissingProperties.Add(oMissingProperty) oResult.MissingProperties.Add(oMissingProperty)
Continue For Continue For
Else Else
_logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oPropertyDescription) _logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oTableColumn)
Continue For Continue For
End If End If

View File

@ -1157,6 +1157,12 @@ Public Class ImportZUGFeRDFiles
Continue For Continue For
End If End If
' ItemType = 0 (normale texte) dürfen nicht leer sein
If oProperty.ItemType = 0 And oProperty.Value.IsNullOrEmpty Then
_logger.Debug("No Mapping for Property [{0}] with empty value, because of ItemType = 0.", oProperty.TableColumn)
Continue For
End If
' If GroupCounter is -1, it means this is a default property that can only occur once. ' If GroupCounter is -1, it means this is a default property that can only occur once.
' Set the actual inserted value to 0 ' Set the actual inserted value to 0
Dim oGroupCounterValue As Integer = oProperty.GroupCounter Dim oGroupCounterValue As Integer = oProperty.GroupCounter