Warn about un-routable content at publish time #17705
Open
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.
Prerequisites
If there's an existing issue for this PR then this fixes #15943 and #15850
Description
When content items with similar (not exactly the same) names are created, URL collisions can happen. See the linked issues for examples.
The content items can still be published and become available via the Delivery API (by ID), but they will not be routable. However, at this point, there is no indication of that, unless one looks at the "Info" section:
This PR adds a warning at publish time, to emphasise the issue:
The "no domains have been configured" warning
We already have a potential warning at play when publishing content - the "no domains have been configured" warning:
The purpose of this warning is partly the same as the new warning added by this PR: to tell the editors that content is not routable.
As it happens, the default culture is always routable - but the warning is still shown when publishing the default culture. I have changed that, because (long story short) it's the only way to detect URL collisions for the default culture.
To avoid spamming the editors with warnings, I have also made sure that the "no domains have been configured" warning takes precedence over the new warning from this PR.
V15+?
All of the affected code has been deleted in V14 🥳 which means we need to create a V15+ counterpart to this PR. As we are not entirely clear on the approach to fixing it in V15+, this task has been added to our internal backlog (46682).
Testing this PR