In the final testing of a custom module (in a source install recently upgraded to DNN 4.5.0) I edited its Module Definition and noticed that after clicking Update the previously checked ISearchable, IPortable, IUpgradable supported features lost their check marks and upon further checking noted that the module's action menu lost its Import and Export commands.
After finding similar behavior when clicking on Update for several core modules (XML, Survey, etc), I then found the following error logged in the EventViewer after each update of a Module Definition:
AssemblyVersion: 04.05.00
PortalID: 0
PortalName: Development
UserID: 1
UserName: host
ActiveTabID: 18
ActiveTabName: Module Definitions
RawURL: /DotNetNuke4/Host/Module Definitions/tabid/18/ctl/Edit/mid/322/desktopmoduleid/94/portalid/0/Default.aspx
AbsoluteURL: /DotNetNuke4/Default.aspx
AbsoluteURLReferrer:
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 519be6d1-8292-48aa-a685-e6c2a50379f9
InnerException: Cannot insert the value NULL into column 'ExceptionMessage', table 'DNN4.dbo.dnn_EventQueue'; column does not allow nulls. INSERT fails. The statement has been terminated.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Data.SqlClient.SqlConnection.OnError
StackTrace:
Message: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ExceptionMessage', table 'DNN4.dbo.dnn_EventQueue'; column does not allow nulls. INSERT fails. The statement has been terminated.at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues)at DotNetNuke.Data.SqlDataProvider.AddEventMessage(String eventName, Int32 priority, String processorType, String processorCommand, String body, String sender, String subscriberId, String authorizedRoles, String exceptionMessage, DateTime sentDate, DateTime expirationDate, String attributes)at DotNetNuke.Services.EventQueue.EventQueueController.SendMessage(EventMessage message, String eventName)
I then tracked down the source of the error to the following line in the UpdateModuleInterfaces method of Website/ModuleDefinitions/EditModuleDefinition.ascx.vb:
oAppStartMessage.ExceptionMessage = Localization.GetString("UpdateInterfacesError", LocalResourceFile)
There is no resource of that name or for "UpdateInterfaces.ErrorMessage" (which would follow the pattern of other localization keys in the code) in the resource file EditModuleDefinition.ascx.vb. The Localization.GetString function returns Nothing which causes the error when the StartMessage is written to the database. Since the event for the "UpdateSupportedFeatures" ProcessorCommand is never placed in the event que, the supported features are never updated and remain unchecked. I found this to be true in the install version of 4.5.0 as well as both source and install for 4.4.1.
I then added a resource for the "UpdateInterfacesError" to the resource file and found that the Supported features were now being properly discovered after clicking Update.