Closed smdooley closed 4 years ago
I'm afraid something strange might be going on in your install somewhere, those repro steps all work fine for me!
Thanks for responding so quickly @nul800sebastiaan. Only things I noted from your example was that I don't have a multi-lingual setup and I've got ModelsBuilder disabled.
Looking at the stacktrace, the Nested Content configuration probably contains a document type alias that doesn't exist anymore, so PureLiveModelFactory.CreateModelList(String alias)
throws an exception.
document type alias
How do you locate a document type alias that doesn't exist anymore?
When using Nested Content in multiple item mode with a single Document Type, seeing the "Object reference not set to an instance of an object" error when viewing a page on the front-end that has that property.
Umbraco version
I am seeing this issue on Umbraco version: 8.5.4
Reproduction
If you're filing a bug, please describe how to reproduce it. Include as much relevant information as possible, such as:
Bug summary
When using Nested Content (Single Document/Element Type | Multiple Item Mode), populated with 1 or more items, is throwing "Object reference not set to an instance of an object" error.
If an additional Document/Element Type is added, everything works as expected.
Specifics
Umbraco 8.5.4 Affects all browsers.
Steps to reproduce
Create a Document Type and mark as an Element Type. Create a Nested Content Data Type. Add one Element Type. Leave all other options as default. Click Save. Create a Document Type and add the Nested Content Data Type as a property. Populate with 0, 1 or more items. Click Save and Publish. In the page View, get the property as follows
View the page on the front-end and you should get
Object reference not set to an instance of an object
.Expected result
The Nested Content property should work when 1 or more items are selected.
Actual result
When viewing the page on the front-end, getting
Object reference not set to an instance of an object
when usingModel.Value<IEnumerable<IPublishedElement>>("items")
orModel.Value<IPublishedElement>("items")
Related Links
https://our.umbraco.com/forum/using-umbraco-and-getting-started//102275-nested-content-object-reference-not-set-to-an-instance-of-an-object#comment-102275