Error when updating blog item

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/4/2014 12:37:15 PM
Gravatar
Total Posts 14

Error when updating blog item

Hi,

over night I have a situation with my mojoPortal site; whenever I try to update a page / blog I get the following error in my system log:

"2014-10-04 10:30:50,906 ERROR 77.248.43.165 - nl-NL - /Blog/EditPost.aspx?pageid=0&ItemID=11200&mid=23 - mojoPortal.Web.Global -  Referrer(http://www.scvalburg.nl/Blog/EditPost.aspx?pageid=0&ItemID=11200&mid=23) useragent Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36 
System.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'ExcludeFromRecentContent', table 'scvalburg_db.dbo.mp_Blogs'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at mojoPortal.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, SqlParameter[] commandParameters)
   at mojoPortal.Data.SqlParameterHelper.ExecuteNonQuery()
   at mojoPortal.Data.DBBlog.UpdateBlog(Int32 moduleId, Int32 itemId, String userName, String title, String excerpt, String description, DateTime startDate, Boolean isInNewsletter, Boolean includeInFeed, Int32 allowCommentsForDays, String location, Guid lastModUserGuid, DateTime lastModUtc, String itemUrl, String metaKeywords, String metaDescription, String compiledMeta, Boolean isPublished, String subTitle, DateTime endDate, Boolean approved, Guid approvedBy, DateTime approvedDate, Boolean showAuthorName, Boolean showAuthorAvatar, Boolean showAuthorBio, Boolean includeInSearch, Boolean useBingMap, String mapHeight, String mapWidth, Boolean showMapOptions, Boolean showZoomTool, Boolean showLocationInfo, Boolean useDrivingDirections, String mapType, Int32 mapZoom, Boolean showDownloadLink, Boolean includeInSiteMap)
   at mojoPortal.Business.Blog.Update()
   at mojoPortal.Business.Blog.Save()
   at mojoPortal.Web.BlogUI.BlogEdit.Save()
   at mojoPortal.Web.BlogUI.BlogEdit.btnUpdate_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
ClientConnectionId:0510f735-5ba9-4338-a8f9-55afb7001eb5
Error Number:515,State:2,Class:16

 

Any ideas?

 

 

 

10/6/2014 11:43:47 AM
Gravatar
Total Posts 18439

Re: Error when updating blog item

The ExcludeFromRecentContent field in the mp_Blogs table should have a default value of 0. I do not know why yours does not.

You should use the table designer in ms sql management tools if possible to add a default value there to fix the problem.

Actually the update stored procedure mp_Blog_Update should also set that value (the default would be needed for insert) so it seems like your database has been messed up like partially upgraded or mismatched with code version and schema version.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.