Commit 4333cb69 authored by Fabian Galinski's avatar Fabian Galinski

[BUGFIX] Loading sys_language records fails with MySQL 5.7

Fixes #11
parent 165b07d2
......@@ -703,13 +703,12 @@ class ConfigurationService extends AbstractService {
* @return array
*/
protected function narrowToUserLanguages(array $languages, BackendUserAuthentication $backendUser) {
if (!empty($backendUser) && !$backendUser->isAdmin()) {
/** @var SysLanguageService $sysLanguageService */
$sysLanguageService = $this->objectManager->get('SGalinski\Lfeditor\Service\SysLanguageService');
if ($backendUser !== NULL && !$backendUser->isAdmin()) {
$sysLanguageService = $this->objectManager->get(SysLanguageService::class);
foreach ($languages as $index => $languageFlag) {
$sysLanguageId = $sysLanguageService->getSysLanguageIdByFlag($languageFlag);
if ($languageFlag === 'default'
|| $sysLanguageId !== NULL && $backendUser->checkLanguageAccess($sysLanguageId)
|| ($sysLanguageId !== NULL && $backendUser->checkLanguageAccess($sysLanguageId))
) {
continue;
}
......
......@@ -53,8 +53,9 @@ class SysLanguageService extends AbstractService {
'uid, title, flag',
'sys_language',
($uids !== NULL ? 'uid IN (' . $typo3Db->cleanIntList($uids) . ')' : ''),
'flag ASC'
'flag, uid'
);
$sysLanguageList = [];
while ($row = $typo3Db->sql_fetch_assoc($res)) {
$sysLanguageList[$row['flag']]['uid'] = $row['uid'];
......
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