The problem was not related to module caching ( although setting the cache time to zero would "appear" to work as it would recycle the cached data for the page ). The real problem was due to incorrect use of the core data cache as the logic was modifying the values of a cached object which it assumed was temporary but was actually tied to the cache reference. The good news is that it was a run-time behavior issue and not a persistence problem ( which would need to be handled by upgrade logic ). Interestingly, this bug appears to have been introduced in 4.4.0 - so I am a bit surprised it has not been logged earlier.
ControlPanelBase.vb
Old Method:
Protected Sub AddExistingModule(ByVal moduleId As Integer, ByVal tabId As Integer, ByVal paneName As String, ByVal position As Integer, ByVal align As String)
Dim objModules As New ModuleController
Dim objModule As ModuleInfo
Dim objEventLog As New Services.Log.EventLog.EventLogController
Dim UserId As Integer = -1
If Request.IsAuthenticated Then
Dim objUserInfo As UserInfo = UserController.GetCurrentUserInfo
UserId = objUserInfo.UserID
End If
objModule = objModules.GetModule(moduleId, tabId, False)
If Not objModule Is Nothing Then
objModule.TabID = PortalSettings.ActiveTab.TabID
objModule.ModuleOrder = position
objModule.PaneName = paneName
objModule.Alignment = align
objModules.AddModule(objModule)
objEventLog.AddLog(objModule, PortalSettings, UserId, "", Services.Log.EventLog.EventLogController.EventLogType.MODULE_CREATED)
End If
End Sub
New Method:
Protected Sub AddExistingModule(ByVal moduleId As Integer, ByVal tabId As Integer, ByVal paneName As String, ByVal position As Integer, ByVal align As String)
Dim objModules As New ModuleController
Dim objModule As ModuleInfo
Dim objEventLog As New Services.Log.EventLog.EventLogController
Dim UserId As Integer = -1
If Request.IsAuthenticated Then
Dim objUserInfo As UserInfo = UserController.GetCurrentUserInfo
UserId = objUserInfo.UserID
End If
objModule = objModules.GetModule(moduleId, tabId, False)
If Not objModule Is Nothing Then
' clone the module object ( to avoid creating an object reference to the data cache )
Dim objClone As ModuleInfo = objModule.Clone()
objClone.TabID = PortalSettings.ActiveTab.TabID
objClone.ModuleOrder = position
objClone.PaneName = paneName
objClone.Alignment = align
objModules.AddModule(objClone)
objEventLog.AddLog(objClone, PortalSettings, UserId, "", Services.Log.EventLog.EventLogController.EventLogType.MODULE_CREATED)
End If
End Sub
Since this change is in a core base class, it requires a recompilation of the core library.