Error saving documents to content tree

paul krysiak asked on January 27, 2017 20:27

Hello Kentico

I am trying to save documents but i get an errors that is not consistent with the TreeNode information

TreeProvider Tree = new TreeProvider(MembershipContext.AuthenticatedUser);
TreeNode AuthorRoot = Tree.SelectNodes().Path("/authors").OnCurrentSite().Culture("en-us").FirstObject;
// this exists AuthorRoot, see image below
   TreeNode AuthorPage = TreeNode.New("CMS.Author", this.Tree);

        AuthorPage.DocumentName = authorName;
        AuthorPage.DocumentCulture = "en-us";
       // AuthorPage.DocumentPageTemplateID = 26076;

            // Creates the Author page
            AuthorRoot.Insert(AuthorPage);

I get these error

  • [TreeNode.GetSiteName]: Site is not specified or specified site does not exist.
  • [DocumentHelper.CheckParameters]: Parent node site not found.
  • this line " parentAuthor.Insert(AuthorPage);"

I know there is a site associated with the tree node, but the save is not recognizing it

Any ideas?

Thanks

Correct Answer

Peter M answered on January 27, 2017 20:51

AuthorPage.Insert(AuthorRoot)

0 votesVote for this answer Unmark Correct answer

Recent Answers


paul krysiak answered on January 28, 2017 01:54

Thanks Peter

I can't believe I had them backwards

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.