Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from liayn/master
Browse files Browse the repository at this point in the history
[BUGFIX] Correctly fetch languages on TYPO3 6.2
  • Loading branch information
spoonerWeb committed Dec 2, 2015
2 parents 873f9ad + 301dc53 commit d94839b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Classes/LanguageDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Plugin\AbstractPlugin;

Expand Down Expand Up @@ -423,12 +424,21 @@ protected function getSysLanguages() {
'1=1'
);
if (!$this->conf['useOldOneTreeConcept'] && $res) {
// Table and field exist so create query for the new approach:
$res = $this->getDB()->exec_SELECTquery(
'uid, language_isocode as isocode',
'sys_language',
'1=1' . $this->cObj->enableFields('sys_language')
);
$currentVersion = VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getCurrentTypo3Version());
if ($currentVersion < 7000000) {
$res = $this->getDB()->exec_SELECTquery(
'sys_language.uid, static_languages.lg_iso_2 as isocode',
'sys_language JOIN static_languages ON sys_language.static_lang_isocode = static_languages.uid',
'1=1' . $this->cObj->enableFields('sys_language') . $this->cObj->enableFields('static_languages')
);
} else {
// Table and field exist so create query for the new approach:
$res = $this->getDB()->exec_SELECTquery(
'uid, language_isocode as isocode',
'sys_language',
'1=1' . $this->cObj->enableFields('sys_language')
);
}
} else {
$res = $this->getDB()->exec_SELECTquery(
'sys_language.uid, sys_language.title as isocode',
Expand Down

0 comments on commit d94839b

Please sign in to comment.