replaceBaseUrlWithCustom should have language parameter

Created on 16 March 2022, over 2 years ago
Updated 13 September 2024, 15 days ago

Problem/Motivation

We have a multidomain, multilingual website and we would like to show the correct language related URLS in the sitemap.
For this to happen we would like to have the language param inside:

  /**
   * Replaces the base URL with custom URL from settings.
   *
   * @param string $url
   *   URL to process.
   *
   * @return string
   *   The processed URL.
   */
  protected function replaceBaseUrlWithCustom(string $url, LanguageInterface $language = NULL): string {
    return !empty($base_url = $this->settings->get('base_url'))
      ? str_replace($GLOBALS['base_url'], $base_url, $url)
      : $url;
  }

This way we can create our own UrlGenerators and override/change where necessary.

Remaining tasks

Review patch attached

Feature request
Status

Needs review

Version

4.0

Component

Code

Created by

🇧🇪Belgium Mschudders

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024