I had an issue with the Children()
# contributing
i
I had an issue with the Children() extension for IPublishedContent, the signature with the predicate returns a
Copy code
cs
IEnumerable<IPublishedContent>?
But subsequently calls an overload of Children which returns a
Copy code
cs
IEnumerable<IPublishedContent>
Am I right to say the first signature cannot return null? Otherwise I will open an issue and make my first contribution to the CMS 😃
a
Are you on Umbraco 10 or 12? This should have been corrected in Umbraco 13 so the return value isn't nullable 😍
i
I am on 13.2 currently
This highlight is taken from the contrib branch
i
Yeah all of the children methods are fine, except the one where you just pass an expression. Which is weird. I'll open an issue
a
Yes, this seems like an oversight. All the
Children
methods in
PublishedContentExtensions.cs
seem to be correct, but not all in
FriendlyPublishedContentExtensions.cs
. The friendly methods call the "non friendly", so AFAIK it should be the same. So good idea creating an issue 👍
i
Thanks for the input! Yeah I recall reading about a patch note addressing nullable warnings. So that's why I doubted if this would be expected/wanted
a
Yes, some changes may be considered breaking. But they are still worth fixing so it's correct in future versions of Umbraco
i
I mentioned it in the PR, but I noticed there's a whole lot more that Rider auto detected, some of which are obsolete methods, but even excluding those Its closer to 40 methods. Think I mention that in the issue, as it seems a great fix to just get them all at once
3 Views