cdaecke / md_saml

TYPO3 SSO Login with SAML authentication
Other
2 stars 8 forks source link

Exception in `getRootPageId()` with `languages` and different TLDs #17

Closed web-it-solutions closed 4 months ago

web-it-solutions commented 4 months ago

Hello, In SettingsService.php line 132 the rootPageId is fetched only if the host of the base url equals the $siteUrl (TYPO3_HOST_ONLY).

In case you have a multilanguage setup with different top level domains mapped to the language(s) the service will not find a valid rootPageId and the exception 1648646492 is thrown.

Would it be a good idea to do the following in the foreach loop?

foreach ($site->getLanguages() as $language) { if ($language->getBase()->getHost() == $siteUrl) { return $site->getRootPageId(); } }

I would start a PR if you agree with the mentioned solution!

Thanks for bringing this to TYPO3 12.

cdaecke commented 4 months ago

Hello,

sounds like a good idea. Pull request is very welcome!

cdaecke commented 4 months ago

Thanks a lot!

Version 3.0.5 of extension is released.

web-it-solutions commented 4 months ago

Thank you for super-fast merging. Works like a charm now ;-)