Adding a page and then deleting it throws YSOD of death instead of a friendly message?
If I have a website called www.test.com and a blog node does not exist under the page www.test.com, yet and I try to access www.test.com\blog, I get the umbraco message:
No umbraco document matches the url /blog. This is fine, however, when I add the blog node and access the page, it comes up fine, but now when I delete it and try to go to www.test.com\blog, instead of getting the No umbraco document matches the url message, I get the following:
Object reference not set to an instance of an object.
I have 2 websites and both point to the same view. The one that I didn't delete the blog page comes up fine, but the one that did throws a YSOD instead of a message like it can't find the url.
Have you unpublished the blog node before deleting it ?
if you look in the app_data/umbraco.config file this contains an xml version of content that has been published; if you haven't unpublished then the deleted node may still appear in here.
to fix, if you rebuild the xml file by visiting
/umbraco/dialogs/republish.aspx?xml=true
then the rogue item should be removed from umbraco.config xml cache file and your site should go back to saying node does not exist...
Here are all the things I tried, but nothing worked.
I deleted the node and then republished
I unpublished the node and then replublished
I republished by right clicking and by using the link you specified
I also noticed that on the website that I have pointing to my localhost, I can see the umbraco.config update when I remove the node. When I refresh the page I just deleted, I don't get the YSOD, I get a cached page which doesn't seem to go away even after doing a hard refresh.
Here is a thought I had, but I don't see how this could be a problem. I have a document type blog and a template blog. Both my websites websiteA.com and websiteB.com use the same template. It shouldn't matter if websiteA.com has a blog section and websiteB.com has a blog section, right?
Also, this started off as a Visual studio project, does it make a difference if I have included blog.cshtml in my project. I know when you create the template through Umbraco, it leaves it excluded?
If you have a blog post you want to remove you need to 'Unpublish' first
and then delete it.
UnPublish will remove it from the umbraco.config xml file for the server on which you are unpublishing. It will tell the database that the document is unpublished. Deleting will then remove it from the database.
It sounds like to me you have several environments, local, test, all pointing to the same database ?
If so unpublishing the document on the local url, will remove it from the umbraco.config cache file on the local machine; but NOT from the www.test.com's umbraco.config cache file. It will tell the database it is unpublished.
So open up the umbraco.config file in each of your environments, and verify the node you deleted, has been removed from each copy in each environment.
Rebuilding the Umbraco.Config file by using the url /umbraco/dialogs/republish.aspx?xml=true on each environment 'should' rebuild the cache file from the database for each environment and make sure the deleted node has gone from everywhere...
Adding a page and then deleting it throws YSOD of death instead of a friendly message?
If I have a website called
www.test.com
and ablog
node does not exist under the pagewww.test.com
, yet and I try to accesswww.test.com\blog
, I get the umbraco message:No umbraco document matches the url
/blog
. This is fine, however, when I add the blog node and access the page, it comes up fine, but now when I delete it and try to go towww.test.com\blog
, instead of getting theNo umbraco document matches the url
message, I get the following:Object reference not set to an instance of an object.
I have 2 websites and both point to the same view. The one that I didn't delete the blog page comes up fine, but the one that did throws a YSOD instead of a message like it can't find the url.
Hi Saied
Have you unpublished the blog node before deleting it ?
if you look in the app_data/umbraco.config file this contains an xml version of content that has been published; if you haven't unpublished then the deleted node may still appear in here.
to fix, if you rebuild the xml file by visiting
/umbraco/dialogs/republish.aspx?xml=true
then the rogue item should be removed from umbraco.config xml cache file and your site should go back to saying node does not exist...
regards
marc
Hi Marc,
Here are all the things I tried, but nothing worked.
umbraco.config
update when I remove the node. When I refresh the page I just deleted, I don't get theYSOD
, I get a cached page which doesn't seem to go away even after doing a hard refresh.Here is a thought I had, but I don't see how this could be a problem. I have a
document type blog
and atemplate blog
. Both my websiteswebsiteA.com
andwebsiteB.com
use the same template. It shouldn't matter ifwebsiteA.com has a blog section
andwebsiteB.com has a blog section
, right?Also, this started off as a Visual studio project, does it make a difference if I have included blog.cshtml in my project. I know when you create the template through Umbraco, it leaves it excluded?
Thanks, Saied
Hi Saied
If you have a blog post you want to remove you need to 'Unpublish' first and then delete it.
UnPublish will remove it from the umbraco.config xml file for the server on which you are unpublishing. It will tell the database that the document is unpublished. Deleting will then remove it from the database.
It sounds like to me you have several environments, local, test, all pointing to the same database ?
If so unpublishing the document on the local url, will remove it from the umbraco.config cache file on the local machine; but NOT from the www.test.com's umbraco.config cache file. It will tell the database it is unpublished.
So open up the umbraco.config file in each of your environments, and verify the node you deleted, has been removed from each copy in each environment.
Rebuilding the Umbraco.Config file by using the url /umbraco/dialogs/republish.aspx?xml=true on each environment 'should' rebuild the cache file from the database for each environment and make sure the deleted node has gone from everywhere...
is working on a reply...