In Kentico 13.0.157, I'm using the IPageRetriever to return a set of pages to use in the footer of my site. I have a page that was unpublished back in 2023 that is periodically being returned and displayed in the footer list. My use of IPageRetriever is quite simple so I'm not sure what the cause of the problem is. Has anyone else encountered this with IPageRetriever and figured out a way to prevent it from happening again? I've encountered this issue with other instances of IPageRetriever on this website, but this example is the most visible since it is seen on every page of the site.
Here's a code sample that shows the relatively simple use of RetreiveAsync.
var regions = await _pageRetriever.RetrieveAsync<Region>(
query => query
.Columns(
nameof(Region.NodeSiteID),
nameof(Region.NodeID),
nameof(Region.NodeGUID),
nameof(Region.NodeAliasPath),
nameof(Region.NodeLevel),
nameof(Region.NodeOrder),
nameof(Region.DocumentName),
nameof(Region.DocumentCulture))
.Path(path, PathTypeEnum.Children));
return regions.Select(r => new MenuItemViewModel<Region>
{
RegionNode = r,
PageUrl = _pageUrlRetriever.Retrieve(r).AbsoluteUrl
});