When using drush command with host make correct url for all scenarios.

Created on 18 November 2022, about 2 years ago
Updated 12 July 2024, 4 months ago

Problem/Motivation

In drupal website we use multilanguage. There language is detected by path. We use domain setting so website has domain prefix.
When using drush command with host, Url::fromRoute returns absolute path and on top adds it with our given host. So we get incorrect url.

Steps to reproduce

To reproduce:
In website enable extra language.
Make language detection by url.
Select domain to determine language with language prefix.
Try drush commands.

Proposed resolution

In command, when making url with host dont use simply Url:fromRoute->toString() but change toString to getInternalPath, This way we make sure that url path from route name will be internal.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇱🇹Lithuania ugas19

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

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