Add host "default" to custom links, if generate sitemap from drush

Created on 3 February 2023, about 2 years ago

Problem/Motivation

When you generate sitemap from drush commands drush:rebuild or drush:regenerate, you will see that generated sitemaps could has another host in custom links (by default, it is host "default").
It is related to that $base_url was removed from settings.php in Drupal 8 and when you do commands from drush, you will get by default host = "default", not your current host name of site. This is issue not related to actions with generation sitemap from UI xmlsitemap module, only from drush commands.

Steps to reproduce

Add few custom links for indexation from UI. For example: /contact
Run drush:rebuild or drush:regenerate from command line of your application.
Check generated sitemaps and will see you custom link as: http://default/en/contact

Proposed resolution

Refactor code of XmlSitemapGenerator and apply correct hostname to custom links.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.4

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine ankondrat4 Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024