x First time here? Check out the FAQ
Please report confirmed 4.1 bugs in our issue tracker at CodePlex
  • Avatar3036posts8600karma
    admin

    v4.1RC - Deleting property from doc-type throws exception

    Lee Kelleher started this topic June 16, 2010 @ 12:53, Go directly to the topic solution

    Playing around with v4.1RC and found an error when trying to delete a property from a document-type.

    I get the following exception, with stack trace:

    The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "umbraco41", table "dbo.cmsPropertyData", column 'propertytypeid'.
    The statement has been terminated.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "umbraco41", table "dbo.cmsPropertyData", column 'propertytypeid'.
    The statement has been terminated.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    
    
    [SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "umbraco41", table "dbo.cmsPropertyData", column 'propertytypeid'.
    The statement has been terminated.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
       System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +2840828
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +504
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +327
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +167
       umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\datalayer\SqlHelpers\SqlServer\SqlServerHelper.cs:75
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\datalayer\SqlHelper.cs:220
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\datalayer\SqlHelper.cs:226
       umbraco.cms.businesslogic.propertytype.PropertyType.delete() in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\cms\businesslogic\propertytype\propertytype.cs:326
       umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbraco\controls\ContentTypeControlNew.ascx.cs:447
       umbraco.controls.GenericProperties.GenericPropertyWrapper.GenericPropertyWrapper_Delete(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbraco\controls\GenericProperties\GenericPropertyWrapper.cs:86
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       umbraco.controls.GenericProperties.GenericProperty.DeleteButton2_Click(Object sender, ImageClickEventArgs e) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbraco\controls\GenericProperties\GenericProperty.ascx.cs:249
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +134
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691

    Can anyone else confirm this is an error, and not just me being daft? If so, I'll raise it on CodePlex.

    Cheers, Lee.


  • Avatar82posts328karma
    Comment with ID: 36208
    Gerty Engrie posted this reply June 16, 2010 @ 09:22

    works fine here maybe a combination of things?


  • Avatar1763posts1737karma
    adminComment with ID: 36210
    Morten Bock posted this reply June 16, 2010 @ 09:39

    I'm not getting an exception (I think), but I am seeing weird behavior. 

    When i delete the property (without clicking save), and refresh the doctype, the property has moved to the General tab. It has disappeared from the actual documents, but still lingers around.

    If I delete and save, then I get an exception of some sort (happened yesterday).

    So there is something fishy with deleting properties I think.


  • Avatar3036posts8600karma
    adminComment with ID: 36513
    Lee Kelleher posted this reply June 21, 2010 @ 11:05

    I've got another fresh install of v4.1RC (from CodePlex, not nightly) ... and this error doesn't happen now.  So yes, Gerty, it was probably a combo of other things.

    ... with that said, I'm not getting the same problem as Morten. Deleting a property moves it from a tab into the 'Generic Properties' tab. Very strange!

    Cheers, Lee.


  • Niels Hartvig posted this reply June 21, 2010 @ 11:53

    It's a cache thing - could you submit to CP and then I'll fix :)


  • Avatar3036posts8600karma
    adminComment with ID: 36522
    Lee Kelleher posted this reply June 21, 2010 @ 12:36

    Done: http://umbraco.codeplex.com/workitem/27783

    Thanks, Lee.


  • Avatar1779posts1618karma
    HQComment with ID: 36534
    Niels Hartvig posted this reply June 21, 2010 @ 01:49

    Fixed.


  • Avatar553posts951karma
    Comment with ID: 60082
    Matt Taylor posted this reply January 11, 2011 @ 04:37

    I don't think it is fixed, I've just come accross the same thing in 4.5.2.

    See here.

     


  • Mila posted this reply March 20, 2012 @ 02:33

     

    I have tryed to delete a document type in my project and I'm getting the follow message:

    Error handling action

    There was an error processing the request.

    The log viewer error shows:

    At /umbraco/settings/editNodeTypeNew.aspx?id=1082 (Referred by: http://butao.autotrac.com.br/umbraco/settings/editNodeTypeNew.aspx?id=1082): umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery ---> System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "umbraco", table "dbo.cmsPropertyData", column 'propertytypeid'.
    The statement has been terminated.
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)
    at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
    --- End of inner exception stack trace ---
    at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
    at umbraco.cms.businesslogic.propertytype.PropertyType.delete()
    at umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e)
    at System.EventHandler.Invoke(Object sender, EventArgs e)
    at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
    at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    I have no idea how to fix it.

    My umbraco version is 4.7.1.1


  • Avatar553posts951karma
    Comment with ID: 111430
    Matt Taylor posted this reply March 20, 2012 @ 03:30

    Hi Mila,

    I had to fix my problem by editing the database. See here http://our.umbraco.org/forum/ourumb-dev-forum/bugs/16154-Error-deleting-property-from-top-most-document-type

    Regards,

    Matt


  • Mila posted this reply March 20, 2012 @ 03:36

    Hi Matt,

    thank you very much, I'll have a look.

    Mila


Please login or Sign up To post replies