terminal42 / contao-changelanguage

ChangeLanguage is an extension for the Contao CMS which allows visitors to switch between different languages of your website.
44 stars 35 forks source link

Port is not included in link (Contao 4.7) #163

Closed bytehead closed 5 years ago

bytehead commented 5 years ago

Affected version(s)

3.1.11 with Contao 4.7.x

Description

The href of the change language link doesn't include any port from the origin uri.

How to reproduce

Run your installation on the internal PHP server or with the symfony cli on a specific port, like https://127.0.0.1:8000.

Target state (example): https://127.0.0.1:8000/en

Actual state (example): https://127.0.0.1/en

Update: Maybe it's just related to the symfony cli and/or cmf routing?

Toflar commented 5 years ago

Afaik we use PageModel::generateAbsoluteUrl(). Does your root page config include the port?

bytehead commented 5 years ago

Nope it doesn't and has never before. I think something changed with the introduced cmf router in Contao 4.7.

aschempp commented 5 years ago

Regardless of that, it must be a Contao core issue. Can you open an issue there?

bytehead commented 5 years ago

Hmm, Contao generates the urls correctly (with the port included). Sounds weird, but it is the case. I'll investigate a little bit more.

bytehead commented 5 years ago

It happens because of the rootUseSSL setting. Uses wrong port, if rootUseSSL = false but the page is requested via https (see also https://github.com/contao/contao/pull/350).

bytehead commented 5 years ago

So known limitation 🙂