Default ContentFilter Fixes (0 entries fixes) #118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's been a few issues picked up regarding this package where people are posting "Scheduled job ran but shows 0 entries".
My team and I ran into the same thing and then I realized why when I looked at the default ContentFilter.
Here's some improvements to the default ContentFilter that hopefully makes sense.
1) The first thing I picked up is, we ran into a case where much of our content could not be cast to
IVersionable
and the logic here assumes that content is unpublished if it can't be cast toIVersionable
which is a dangerous assumption but also tricky, as we can't assume the opposite either.I added an option in SitemapOptions so the consuming party can decide whether this strict check is necessary (If they decide to use the default ContentFilter)
2) The 2nd thing I picked up is that the
IsVisibleOnSite
check prohibits this package from working in any sort of headless site by default (If using the default ContentFilter).In addition to the previous prop, I also added a
SiteArchitecture
enum which defaults to Mvc, but can be set to headless. This just skips theIsVisibleOnSite
check if the site architecture is set to headless by the consuming party of this package.I hope this makes sense, I'm open to suggestions / adjustments.