Closed peereflits closed 1 month ago
hi @peereflits
Have you had a look at this blog post I wrote a while back? https://robertlinde.se/posts/why-is-my-item-null-contentful-net/
Not sure if this is the root cause in this particular scenario, but setting a content type resolver and also potentially ResolveEntriesSelectively
might resolve the issue.
Hi @Roblinde , Thanks for the feedback. I'll look into it.
@Roblinde : I didn't have the time/opportunities to dive into your sugestion. My bet is that https://github.com/contentful/contentful.net/pull/343 will solve it. (@kheurterincentro & I where on the same project where the issue ocurred.)
@peereflits great, I'll look at that PR and get it packaged into a version shortly.
@peereflits this should now be resolved in version 8.0.0
Scenario:
Given a rich text field that has one entry "X" and that appears multiple times, once as inline and once as embedded block, When it is serialized as a
Document
in the SDK It should have aData.Target
of theIContent
nodes of entry "X"Actual: The first
IContent
node has aData.Target
instance ofJObject
that can be serialized as 'entry "X"' The secondIContent
node has aData.Target
property ofnull
Expected: Both
IContent
nodes hava aData.Target
instance ofJObject
that can be serialized as 'entry "X"'Detail information / steps to reproduce
Given Contentfull content type:
This type can be serialized as dotnet type:
In Contentful prepare an instance of richTextTyDemo and add an "embedded-entry-inline" entry that references an other content type instance and add an "embedded-entry-block" that references the same content type instance.
When execute a query with a valid
entryId
like this:The result of this query should be:
result
is not null and of typeRichTextDemo
=> trueresult
has a propertyText
of typeDocument
and is not null => trueText
has twoIContent
nodes with aData.Target
propoerty that can be serialized to that referenced instance => falseThe first
IContent
node has a serializableData.Target
.The second
IContent
node has aData.Target
that isnull
.I suspect that the error is in the
ContentfulClient
between Line 233 and Line 271.