Within a fresh installation of Umbraco 8.5.5, I've created a document type with nested content.
After trying to read the elements within the nested content property (using Model.Value<>
The nested content document type is an Element type, and in Umbraco I can fill everything as it should. In the Razor view things are not working as it should.
Does anybody else have this problem or possibly a solution?
This is the part that is throwing an exception:
var slides = Model.Value<IEnumerable<IPublishedElement>>("slides");
Well, that shouldn't matter. In case I do not put any elements in the property, this still does not mean that calling this method should throw an exception.
But yes, there is data in the property.
And again, today we setup new brand new Umbraco 8 installation and using nested content directly results in NULL references. Exactly as described above. What are we doing wrong and doesn't anybody else have this issue?
Hi! I'm also getting this error when I'm accessing the property when rebuilding the index. I have a custom examine event set up for the transforming index values, and I need to get this data out. Any thoughts why this issue is occuring?
Nested Content throwing NULL reference exception
Hi,
Within a fresh installation of Umbraco 8.5.5, I've created a document type with nested content.
After trying to read the elements within the nested content property (using Model.Value<>
The nested content document type is an Element type, and in Umbraco I can fill everything as it should. In the Razor view things are not working as it should.
Does anybody else have this problem or possibly a solution?
This is the part that is throwing an exception:
Regards,
Paul
Have you actually got any "slides" setup in the backoffice?
Well, that shouldn't matter. In case I do not put any elements in the property, this still does not mean that calling this method should throw an exception. But yes, there is data in the property.
And again, today we setup new brand new Umbraco 8 installation and using nested content directly results in NULL references. Exactly as described above. What are we doing wrong and doesn't anybody else have this issue?
Hi! I'm also getting this error when I'm accessing the property when rebuilding the index. I have a custom examine event set up for the transforming index values, and I need to get this data out. Any thoughts why this issue is occuring?
In case anybody runs into this, I had a repository getting me my page from Umbraco using:
This grabbed me my page data, but since the context was displosed, it couldn't get my nested content data.
I had to move all my data processing code inside of the using statement, and things started working:
is working on a reply...