Problem/Motivation

Adding 'File' as a custom entity through the XML Sitemap configuration results in broken sitemap URL's.

Steps to reproduce

  1. Configure Custom Entity Settings at: admin/config/search/xmlsitemap/entities/settings
  2. Tick file, configure Sitemap Settings to be included, save changes
  3. Rebuild sitemap links: admin/config/search/xmlsitemap/rebuild
  4. Rebuild cron: admin/config/system/cron
  5. Navigate to YOUR_DOMAIN/sitemap.xml
  6. File links are broken

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork xmlsitemap-2820002

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xiwar created an issue. See original summary.

xiwar’s picture

I have attached a patch for this issue. This removes the duplicate host for file entities.

xiwar’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: broken_file_url-2820002-2.patch, failed testing.

jatinkumar1989’s picture

Component: Code » xmlsitemap.module
jatinkumar1989’s picture

Component: xmlsitemap.module » Code
Pranay Agarwal’s picture

#2 Thanks. Your solution is exactly what I was looking for.

Dave Reid’s picture

I don't believe file entities should be includable in the sitemap without something like the File Entity module. If we do need this still I would prefer this code live in a file_xmlsitemap_link_alter() hook implementation that we add to xmlsitemap.module on behalf of the core file module.

ipo4ka704 made their first commit to this issue’s fork.

ipo4ka704’s picture

As I see after this commit https://www.drupal.org/project/xmlsitemap/issues/3079398#comment-13681272 we can't include files entity type for xmlsitemap, so I think we can close this issue.

Dave Reid’s picture

Status: Needs work » Closed (won't fix)

Marking as won't fix, agreed.