Commit 4da58073 authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12588 catch exception in rare situation and fix unittest

parent ea73b215
Pipeline #5410 failed with stages
in 2 minutes and 8 seconds
......@@ -86,10 +86,19 @@ class T3Info {
*/
public static function getBaseUrlLang()
{
if (!T3Handler::isTypo3Loaded()) {
return null;
}
$lid = self::getLanguageId();
if ($lid !== '' && is_numeric($lid) && T3Handler::typo3VersionGreaterEqual9()) {
$lid = intval($lid);
$sf = new \TYPO3\CMS\Core\Site\SiteFinder();
try {
// In an API call Typo3 might have been loaded manually by QFQ at some earlier point. But the following line does not work in that case.
$sf = new \TYPO3\CMS\Core\Site\SiteFinder();
} catch (\Throwable $e) {
return null;
}
$allSites = $sf->getAllSites();
if (count($allSites) > 1) {
Thrower::userReportException('Site language Error.', 'QFQ is does not run on Typo3 setup with multiple sites yet. Please contact QFQ maintainers.');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment