If the document that the relative content path of an __index__ points to is unpublished _++_the index sitemap item is still the one matched during matching phase and during rendering the component configuration of the index sitemap is used which evaluates to a page not found.
org.hippoecm.hst.platform.matching.BasicHstSiteMapMatcher [line:170] the check uses .itemExists() for the handle of the document which always returns true for an existing document.
Steps to reproduce
- Add an explicit sitemap item eg banners with an overview page configuration.
- Add an index sitemap item under the explicit banners with a detail page configuration and relative content path to an existing document.
- Depublish the document that index is pointing
- Visit localhost:8080/site/banners
As the document is not available the matching should fall back to the explicit sitemap item and the users see the banners overview page.
User gets a page not found.
Please see in the attached files an archetype (index.zip) with the reproduction of the issue.
Available urls : http://localhost:8080/site/banners
Publish/Depublish : Banner document under /content/documents/index/banners/index
I have also attached a patch with a possible fix that seems to work.