Skip to content
Article

Can’t publish pages from the root of an Umbraco site?

I recently came across an issue when working with Umbraco (v 3.0.5) pertaining to the publishing of a node that lives directly at the root of the site.  For some reason I kept receiving the “Error: Publising failed because the parent page isn’t published” (side note: Publishing is spelled wrong in the speech bubble that pops up at the bottom right).  This message seems straight forward and easy to solve right?  Well it would be an easy solution if the node I just created was not directly at the root of the site.

So how is it that I came across this error?  How is it possible that the root of the site is not published, but I can still successfully view the pages on the front end of the site?  HOW CAN I PUBLISH THE ROOT?!?

After reviewing a couple of blog posts the most prominent answer seemed to be to right-click the Root Node and choose the “Republish entire site” option.  I tried this but unfortunately it did not solve my problem, that would have been too easy.

Republish entire site
View this menu by right-clicking the root node of your site

 

In normal circumstances this probably would have fixed the problem, but this was not the case for our scenario.  During development the root node was accidentally deleted, which sent it into the Recycling Bin of the site.  Umbraco’s default behavior updates the umbracoNode table to modify the path of the node  and set it to the appropriate value for the application to assume the node is in the trash can (“-1,-20,-1”).

Database Record
View of SQL Server database record for the root node

The path column is important for the location of the actual node in the site, but the column that is really causing the issue for me is the “level” column.  By default, the level of the root node for Umbraco sites is 0.  In this scenario, since we deleted the root node it was moved into the Recycling Bin of the site and Umbraco did something behind the scenes to set the level of the root node to 1.

To resolve the issue, we simply look into our database, view the umbracoNode table and modify these two column values to reflect the appropriate values for the root node (the root node should have an id of -1).  Change the “level” column back to 0 and set the “path” column to -1 and you should now be able to publish nodes freely from the root of the site.

Have you run into something similar or know a different way to resolve this?

The Atlantic BT Manifesto

The Ultimate Guide To Planning A Complex Web Project