Problem/Motivation
There are situations where it's handy to add a custom link to the sitemap which doesn't exist as a link in the local drupal system and which isn't a file on the hardisk; e.g.:
- when a CDN or edge-server is configured to provide cached or redirected content for a specific URL at your domain.
- when a secondary application under the same domain and/or filesystem also provides content via a Front Controller Paradigm.
In these situations, the site maintainer knows that the URL is valid and needs to be added to the sitemap even if the module cannot validate it.
Steps to reproduce
Add redirected or cached content to the CDN or edge server for a domain, and then attempt to add that path to the sitemap via the Custom interface (i.e. /admin/config/search/xmlsitemap/custom); an error occures preventing the saving of the form.
Proposed resolution
Ideally, provide a persistent option in the Add/Edit Custom form that provides the ability to override security checks on a specific URL and save the link. Alternately, provide a one-time override of the security checks that can be activated when saving the value; this is the solution provided in the attached patch.
Remaining tasks
Either integrate the provided solution, or improve on it to make it a persistent property within the Custom module.
User interface changes
Additional checkbox on the Custom Add/Edit admin page.
API changes
None.
Data model changes
For the ideal solution, add an additional field to store the override option.