Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Petr Snobelt 923 posts 1535 karma points
    May 27, 2010 @ 22:38
    Petr Snobelt
    0

    How to delete property using db?

    Hello,

    I add property (with RRC) to my DocumentType, but Timeout occured duuring save or change on DocumentType. I then repeat it and it looks ok in developer's section. But when I try edit content with this document YOSD occured.

    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

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +54
    umbraco.controls.ContentControl..ctor(Content c, publishModes CanPublish, String Id) +780
    umbraco.cms.presentation.editContent.OnInit(EventArgs e) +368
    System.Web.UI.Control.InitRecursive(Control namingContainer) +333
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378

     

    I then try remove this property, but without luck - another YOSD with this stack trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.cms.businesslogic.propertytype.PropertyType.delete() +77
    umbraco.controls.ContentTypeControlNew.gpw_Delete(Object sender, EventArgs e) +52
    umbraco.controls.GenericProperties.GenericPropertyWrapper.GenericPropertyWrapper_Delete(Object sender, EventArgs e) +28
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    umbraco.controls.GenericProperties.GenericProperty.DeleteButton2_Click(Object sender, ImageClickEventArgs e) +28
    System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
    System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
    System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Is it possible to delete this property in db?

    I know Id of property and Id of documenttype

    Thanks

  • Petr Snobelt 923 posts 1535 karma points
    May 27, 2010 @ 22:56
    Petr Snobelt
    0

    I find a row in cmsPropertyType and change it's Node id to 99999 and it helps.

     

  • Petr Snobelt 923 posts 1535 karma points
    Oct 02, 2010 @ 06:55
    Petr Snobelt
    0

    It looks like nobody else has same problem, but it occurred to me again. 

    I figured out that timeout is caused by populatePropertyData on umbraco.cms.businesslogic.ContentType 

    This function adding empty data to all versions :-o of your created content. If you try add property to frequently used datatype it end with sql timeout error.

    Solution is runing following sql (with bigger timeout)

    insert into cmsPropertyData (contentNodeId, versionId, propertyTypeId) select contentId, versionId, @propertyTypeId from cmsContent inner join cmsContentVersion on cmsContent.nodeId = cmsContentVersion.contentId where contentType = @contentTypeId

    I don't know all umbraco internals, but adding new property to old versions looks like wasting db space.

    Petr

    BTW:Adding Connect Timeout property to umbracoDbDSN don't help

     

     

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Oct 03, 2010 @ 07:43
    Richard Soeteman
    0

    Hi Petr,

    Had the same issue a while back only didn't seen your post.I wrote a blogpost about this. I solved this by writing a usercontrol that loops through the content and deleted the property from the contenttype. I've created a CodePlex issue for this which is resolved now.

    Cheers,

    Richard

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies