I'm experiencing some odd behvaiour with a doctype that has a nestedcontent property.
Whenever i try to access the property it throws an Argumentexception with the message "Empty guid."
The property has a few values set ind the backoffice:
I'm using modelsbuilder and is accessing the property through the generated models:
...
var contentPage = Umbraco.Content(id.Value);
if (contentPage == null || !(contentPage is DefaultPage))
return (BadRequest("Unexpected nodetype"));
var homepage = (DefaultPage)contentPage;
if(homepage.DefaultValues != null)
{
foreach(var kvp in homepage.DefaultValues)
{
BackendRequest.Add(kvp.Key, kvp.Value);
}
}
I can't find any similar issues on this or other tech forums.
Worth noting that this is happening in an API controller extending UmbracoApiController.
For anyone else coming across this post - we had a similar issue and it worked out to be when pasting nested content from another nested content block.
To resolve this, we have to past the content, then expand every nested content block to show the data that was pasted in. If we hit save and publish then it all works properly.
Kristian and this comment helped me solve my issues. I originally used "key" as a property name but even after renaming I still got the "empty guid" error. Deleting the content node finally fixed everything.
We are also getting this; fortunately it's in a development environment where I'm testing, but the solutions above won't work for us as it's an automatic process that loads around 400 documents from XML.
The process sets accordion data into Nested Content like this:
This used to automatically set the key value in the UmbracoPropertyData table, but now it seems that it sets a blank Guid instead - this then can't be parsed or loaded on the front end.
I'm going to try manually inserting the key but this seems like a pretty serious bug - I will raise it with support!
Just a though : You could try something like copy & paste, but in code, during the process above ?
// import stuff and save doc. New doc is 1592
var documentToCopy = contentService.GetById(1592);
var newDoc = contentService.Copy(documentToCopy, 1558, false, 0);
// pushish newDoc
// delete oldDoc
It appears I can "fix" it by just adding the key to the object myself - I might need to revisit this if they fix the bug! (Also I'm making the dangerous assumption here that the Guid I generate isn't going to be used elsewhere, although I think that's fairly safe).
Unfortunately this is only one update and there are lots, so deleting/adding new documents would generate a massive overhead - it would only be on the back office server, but it would play havoc with the process I think.
Have you tried the steps above i mentioned ? Try creating a copy of the page and seeing if the copy still throws the error.
Just make sure when you create the copy you unselect the "relate to original" option
Nested Content throws Empty guid. argument exception
I'm experiencing some odd behvaiour with a doctype that has a nestedcontent property. Whenever i try to access the property it throws an Argumentexception with the message "Empty guid."
The property has a few values set ind the backoffice:
I can't find any similar issues on this or other tech forums.
Worth noting that this is happening in an API controller extending UmbracoApiController.
Figured it out now. It was because i named a property "key" on the element type used in the nested content.
This overrides the existing key property which contains a guid.
I renamed the properties, and it works.
For anyone else coming across this post - we had a similar issue and it worked out to be when pasting nested content from another nested content block.
To resolve this, we have to past the content, then expand every nested content block to show the data that was pasted in. If we hit save and publish then it all works properly.
For anyone running into this, it looks like a bug in Umbraco when using the copy and paste funtion for content in a nested list.
I found the easiest way to fix this is to:
The act of creating a copy of that page seems to fix the guids in the nested list. The new copy of the page works fine.
Kristian and this comment helped me solve my issues. I originally used "key" as a property name but even after renaming I still got the "empty guid" error. Deleting the content node finally fixed everything.
We are also getting this; fortunately it's in a development environment where I'm testing, but the solutions above won't work for us as it's an automatic process that loads around 400 documents from XML.
The process sets accordion data into Nested Content like this:
This used to automatically set the key value in the UmbracoPropertyData table, but now it seems that it sets a blank Guid instead - this then can't be parsed or loaded on the front end.
I'm going to try manually inserting the key but this seems like a pretty serious bug - I will raise it with support!
Just a though : You could try something like copy & paste, but in code, during the process above ?
Hacky, but might get you back up and running
It appears I can "fix" it by just adding the key to the object myself - I might need to revisit this if they fix the bug! (Also I'm making the dangerous assumption here that the Guid I generate isn't going to be used elsewhere, although I think that's fairly safe).
Unfortunately this is only one update and there are lots, so deleting/adding new documents would generate a massive overhead - it would only be on the back office server, but it would play havoc with the process I think.
Thanks for the thought though! :)
Getting the same error in 8.11.1..
Have some nested content inside a nested content that trows a "Empty guid" after I copied.
When I open a Nested content. It opens all..
If I copy and then delete each nested content and then insert it again then they works... ?
Tried to open all nested and save.. Didn't do anything..
Have you tried the steps above i mentioned ? Try creating a copy of the page and seeing if the copy still throws the error. Just make sure when you create the copy you unselect the "relate to original" option
It's on the root node, it´s a lot of sub pages that needs to be copied.. :p
I will give it a try
is working on a reply...
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.