Skip to content
Snippets Groups Projects

B16574: Added multiple siteConfigurations compatibility for typo3 v10 and 11. refs#16574

Merged Enis Nuredini requested to merge B16574_multiple_site_configuratoin_failure into develop
1 file
+ 20
4
Compare changes
  • Side-by-side
  • Inline
@@ -113,12 +113,10 @@ class T3Info {
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.');
} elseif (count($allSites) < 1) {
if (count($allSites) < 1) {
return null;
} else {
$site = reset($allSites);
$site = self::getSiteConfiguration($sf);
$lang = $site->getLanguageById($lid);
$base = $lang->getBase();
return (string)$base;
@@ -162,4 +160,22 @@ class T3Info {
return $languagePath;
}
/**
* Returns the site configuration from current page. Used for T3 >=V10.
*
* object $sf
* @return object
*/
public static function getSiteConfiguration($sf): object {
if (T3Handler::typo3VersionGreaterEqual10() && isset($GLOBALS['TYPO3_REQUEST'])) {
$siteIdentifier = $GLOBALS['TYPO3_REQUEST']->getAttribute('site')->getIdentifier();
$actualSite = $sf->getSiteByIdentifier($siteIdentifier);
} else {
$allSites = $sf->getAllSites();
$actualSite = reset($allSites);
}
return $actualSite;
}
}
\ No newline at end of file
Loading