1

Closed

Post New Ad Issue on Save

description

Upon Save of new ad (by admin user (not host admin)), Exception Thrown in DNN:
 
AssemblyVersion: 5.2.2
PortalID: 0
PortalName: xxxx
UserID: 8
UserName: xxxx
ActiveTabID: 328
ActiveTabName: Classifieds
RawURL: /Classifieds/tabid/328/ctl/edit/mid/995/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: xxxx/Classifieds/tabid/328/ctl/edit/mid/995/Default.aspx
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 4722fc4e-ded9-4fe8-af9b-856e2524b913
InnerException: Invalid object name 'csClassifieds'.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Data.SqlClient.SqlConnection.OnError
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Invalid object name 'csClassifieds'. ---> System.Data.SqlClient.SqlException: Invalid object name 'csClassifieds'.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.SqlDataReader.ConsumeMetaData()at System.Data.SqlClient.SqlDataReader.get_MetaData()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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)at System.Data.SqlClient.SqlCommand.ExecuteScalar()at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText)at ComSite.Modules.SimplyClassified.SqlDataProvider.AddItem(ItemInfo& Item)at ComSite.Modules.SimplyClassified.Controller.AddItem(ItemInfo& objItem)at ComSite.Modules.SimplyClassified.Edit.SaveData(Boolean BypassRedirect)--- End of inner exception stack trace ---

 

Ad moves to 'unvalidated' status (waiting to be validated) - but exception is thrown during redirect. You have to refresh the default view to see the ad awaiting validation (if you are an admin) - normal user will get no alert to ad being saved or not (nor notification that ad requires validation.
 
I will see if this is the same issue I had before I patched v1.00.08 to run on my servers before Christmas. If so, I'll submit a patch code for review.
 
DNN v5.2.2 <clean code on upgraded/cleaned DB>
SQL Server 2005 Express
CS-Simply Classifieds v1.00.10 (issue persists from v1.00.09 (maybe earlier))
Closed Mar 31, 2010 at 2:12 PM by jladow
Issue closed and resolved with v1.00.12 stable release.

comments

thecarnie wrote Feb 9, 2010 at 7:04 AM

Notification Emails are sent successfully when ad is submitted. Some exception being thrown, either in refresh cycle or after email is sent but before page reload.

thecarnie wrote Feb 10, 2010 at 2:36 AM

Traced this to a missing Function Call in file /Components/SQLDataProvider.vb:

See lines 135-140 (approx) for the sub "AddItem(ByRef Item As SimplyClassified.ItemInfo)" <-- inside this sub's SELECT statement, a missing "GetFullyQualifiedName()" on the field. See following code for resolution:
    Public Overrides Sub AddItem(ByRef Item As SimplyClassified.ItemInfo)
        SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("AddClassifiedItem"), Item.PortalID, Item.ModuleId, Item.ListType, Item.Category, Item.PostDate, Item.Title, Item.Description, Item.Fee, Item.ContactName, Item.ContactPhone, Item.ContactEmail, Item.ContactUrl, Item.ContactMethod, Item.Status, Item.CreatedByUser)
        ' PATCHED by ss <added GFQN call inside select statement>
        Dim Sql As String = "Select max(id) from " & GetFullyQualifiedName("csClassifieds") & " where ModuleID=" & Item.ModuleId & " and CreatedByUser=" & Item.CreatedByUser
        Item.ID = SqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, Sql)
    End Sub

jkappel wrote Feb 15, 2010 at 11:44 PM

Thank you so much for this submission and your work on finding the issue. We have patched the issue and will release it in version 1.0.11

thecarnie wrote Feb 17, 2010 at 5:50 AM

In that above call that I patched, I found that you need to remove the "cs" from the function. It still fails in the above state, because your GFQN function adds the "cs" module qualifier automatically. Here is the updated patch I'm running:

Public Overrides Sub AddItem(ByRef Item As SimplyClassified.ItemInfo)
SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("AddClassifiedItem"), Item.PortalID, Item.ModuleId, Item.ListType, Item.Category, Item.PostDate, Item.Title, Item.Description, Item.Fee, Item.ContactName, Item.ContactPhone, Item.ContactEmail, Item.ContactUrl, Item.ContactMethod, Item.Status, Item.CreatedByUser)
' PATCHED by ss <added GFQN call inside select statement>
Dim Sql As String = "Select max(id) from " & GetFullyQualifiedName("Classifieds") & " where ModuleID=" & Item.ModuleId & " and CreatedByUser=" & Item.CreatedByUser
Item.ID = SqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, Sql)
End Sub

wrote Mar 27, 2010 at 12:51 AM

wrote Mar 27, 2010 at 12:51 AM

wrote Mar 27, 2010 at 12:52 AM

wrote Mar 30, 2010 at 6:51 AM

wrote Mar 30, 2010 at 6:52 AM

wrote Mar 31, 2010 at 2:12 PM

wrote Feb 13, 2013 at 8:48 PM

wrote May 16, 2013 at 12:00 AM