Copied to clipboard

Flag this post as spam?

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


  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 05, 2011 @ 15:29
    Anthony Dang
    0

    Error handling action No Document exists... - content node delete problem

     

    When I delete a node I get this error message:

     

    Error handling action

    No Document exists with Version '00000000-0000-0000-0000-000000000000'

     

    The node is deleted properly. I have been programatically sorting and moving nodes. Is there anything that I might have tripped over?

     

     

    I do this after save:

    Document newParent = DocumentHelper.GetCorrectParentForPost(date, sender);
    
    if (newParent.Id != sender.ParentId)
    {
        sender.Move(newParent.Id);
        DocumentHelper.SortPostsByDate(newParent.Children, sender);
    }

     

    And here is my sorting method:

     

      /// <summary>
    /// 
    /// </summary>
    /// <param name="posts"></param>
    /// <param name="document"></param>
    public static void SortPostsByDate(IEnumerable<Document> posts, Document document)
    {
        // remove the search node from the list
        IEnumerable<Document> documents = posts.Where(x => x.Id != document.Id);
    
    
        DateTime newDate = DateTime.Parse(document.getProperty("uBlogsyPostDate").Value.ToString());
        var nodeSorter = new umbraco.presentation.webservices.nodeSorter();
        string sortOrder = string.Empty;
    
        if (documents.Count() == 0)
        {
            return;
        }
    
        if (newDate > DateTime.Parse(documents.Last().getProperty("uBlogsyPostDate").Value.ToString()))
        {
            // new document should be at the end
            sortOrder = string.Join(",", documents.Select(x => x.Id)) + "," + document.Id;
            nodeSorter.UpdateSortOrder(document.ParentId, sortOrder);
            return;
        }
    
    
        bool found = false;
        foreach (var d in documents)
        {
            if (newDate <= DateTime.Parse(d.getProperty("uBlogsyPostDate").Value.ToString()))
            {
                // insert post here!
                if (!found)
                {
                    sortOrder += document.Id + ",";
                    found = true;
                }
            }
            sortOrder += d.Id + ",";
        }
    
        nodeSorter.UpdateSortOrder(document.ParentId, sortOrder.TrimEnd(','));
    }

     

     

  • kristian schneider 190 posts 351 karma points
    Jul 05, 2011 @ 15:38
    kristian schneider
    0

    Where do you see the error? In the backend or as an exception?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 05, 2011 @ 16:59
    Anthony Dang
    0

    It's happening on right-click delete.

    I commented out the sorting and it seems that i have the same issue. Possibly not related to any of this.

    The log file shows this:

    Error adding to SiteMapProvider: System.InvalidOperationException: Multiple nodes with the same URL '/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.

       at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)

       at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.loadNodes(String parentId, SiteMapNode parentNode)

     

    Any thoughts?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 05, 2011 @ 17:34
    Anthony Dang
    0

    Oh recycle bin!

    I found the problem!

    I'm accessing the document on the after move event. Deleting a document fires the move event and hence the after move event. 

Please Sign in or register to post replies

Write your reply to:

Draft