Hi Dynamicweb,
We have an issue with a solution with no area with ID = 1, which gives exceptions various places in the administration.
The issue is related to this code section. Can "areaService.GetArea(1)" be changed to finding "FirstOrDefault()"?
Private Shared Function GetCurrentArea() As Area
Dim areaService As IAreaService = Services.Areas
Dim result As Area = Nothing
If Not IsNothing(Context.Current) AndAlso Not IsNothing(Context.Current.Session) AndAlso Not IsNothing(Context.Current.Session("DW_Area")) Then
Dim areaId As Integer = Converter.ToInt32(Context.Current.Session("DW_Area"))
If (areaId > 0) Then
result = areaService.GetArea(Converter.ToInt32(Context.Current.Session("DW_Area")))
End If
End If
If result Is Nothing Then
result = areaService.GetArea(1)
End If
Return result
End Function
Best regards,
Anders