From dbf88a5beac0f4d9c3f20ba3effc5f9d317bd609 Mon Sep 17 00:00:00 2001 From: klange Date: Wed, 12 Jun 2019 14:57:35 +0200 Subject: [PATCH 1/8] [UPGRADE] upgraded dependency checks --- composer.json | 2 +- ext_emconf.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 57878b5..9deeb2a 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "typo3/cms-core": "^7.6 || ^8.7", + "typo3/cms-core": "^9.5", "sjbr/static-info-tables": "^6.4" }, "replace": { diff --git a/ext_emconf.php b/ext_emconf.php index 6a459b5..c390e29 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -15,7 +15,7 @@ 'description' => 'This plugin detects the visitor\'s preferred language and sets the local configuration for TYPO3\'s language engine accordingly. Both, one-tree and multiple tree concepts, are supported. It can also select from a list of similar languages if the user\'s preferred language does not exist.', 'category' => 'misc', 'shy' => 0, - 'version' => '8.1.1', + 'version' => '9.0.0', 'state' => 'stable', 'uploadfolder' => 0, 'clearcacheonload' => 0, @@ -26,8 +26,8 @@ 'CGLcompliance_note' => '', 'constraints' => [ 'depends' => [ - 'php' => '7.0.0-7.1.99', - 'typo3' => '7.6.22-8.99.99', + 'php' => '7.2.0-7.2.99', + 'typo3' => '9.5.0-9.99.99', 'static_info_tables' => '6.4.0-6.99.99' ], 'conflicts' => [], From c435304fc502c48c1b80c84655a23c20143ebae6 Mon Sep 17 00:00:00 2001 From: klange Date: Wed, 12 Jun 2019 15:04:08 +0200 Subject: [PATCH 2/8] [UPGRADE] ignored static info tables version constrains --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9deeb2a..c9d475b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "typo3/cms-core": "^9.5", - "sjbr/static-info-tables": "^6.4" + "sjbr/static-info-tables": "*" }, "replace": { "rlmp_lanugage_detection": "self.version", From dead22944591c178f9d8859dc5887a53eb2997a4 Mon Sep 17 00:00:00 2001 From: klange Date: Wed, 12 Jun 2019 15:52:03 +0200 Subject: [PATCH 3/8] [UPGRADE] replaced deprecated logger calls --- Classes/LanguageDetection.php | 123 ++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 58 deletions(-) diff --git a/Classes/LanguageDetection.php b/Classes/LanguageDetection.php index d134f63..bd511d7 100644 --- a/Classes/LanguageDetection.php +++ b/Classes/LanguageDetection.php @@ -14,10 +14,14 @@ * The TYPO3 project - inspiring people to share! */ +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; use SJBR\StaticInfoTables\PiBaseApi; -use TYPO3\CMS\Core\Database\DatabaseConnection; +use TYPO3\CMS\Core\Log\Logger; +use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Page\PageRepository; use TYPO3\CMS\Frontend\Plugin\AbstractPlugin; @@ -31,8 +35,9 @@ * @author Thomas Löffler * @author Markus Klein */ -class LanguageDetection extends AbstractPlugin +class LanguageDetection extends AbstractPlugin implements LoggerAwareInterface { + use LoggerAwareTrait; /** * @var string @@ -54,6 +59,12 @@ class LanguageDetection extends AbstractPlugin */ public $conf = []; + /** + * @var \TYPO3\CMS\Extbase\Object\ObjectManager + * @inject + */ + protected $objectManager; + /** * @var int */ @@ -64,6 +75,28 @@ class LanguageDetection extends AbstractPlugin */ protected $botPattern = '/bot|crawl|slurp|spider/i'; + /** + * @var Logger + */ + protected $customLogger; + + public function __construct() + { + parent::__construct(); + $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); + + $this->setCustomLogger(); + } + + public function setCustomLogger() + { + /** @var \TYPO3\CMS\Core\Log\LogManager $logManager */ + $logManager = $this->objectManager->get(LogManager::class); + + $this->customLogger = $logManager->getLogger(__CLASS__); + } + + /** * The main function recognizes the browser's preferred languages and * reloads the page accordingly. Exits if successful. @@ -87,18 +120,17 @@ public function main(string $content, array $conf):string && GeneralUtility::_GP($this->conf['languageGPVar']) !== null && GeneralUtility::_GP($this->conf['languageGPVar']) !== '' ) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Break out since language is already selected', $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Break out since language is already selected'); return $content; } // Break out if the last page visited was also on our site: $referrer = (string)GeneralUtility::getIndpEnv('HTTP_REFERER'); - if (TYPO3_DLOG) { - GeneralUtility::devLog('Referrer: ' . $referrer, $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Referrer: ' . $referrer); + if (!$this->conf['dontBreakIfLastPageWasOnSite'] && $referrer !== '' && ( @@ -136,9 +168,8 @@ public function main(string $content, array $conf):string //Get available languages $availableLanguagesArr = $this->conf['useOneTreeMethod'] ? $this->getSysLanguages() : $this->getMultipleTreeLanguages(); - if (TYPO3_DLOG) { - GeneralUtility::devLog('Detecting available languages in installation', $this->extKey, 0, $availableLanguagesArr); - } + + $this->customLogger->log(0,$this->extKey . ' Detecting available languages in installation', $availableLanguagesArr); //Collect language aliases $languageAliases = []; @@ -170,9 +201,8 @@ public function main(string $content, array $conf):string break; } - if (TYPO3_DLOG) { - GeneralUtility::devLog('Detecting user browser languages', $this->extKey, 0, $acceptedLanguagesArr); - } + $this->customLogger->log(0,$this->extKey . ' Detecting available languages in installation', $acceptedLanguagesArr); + //Break out if the default languange is already selected //Thanks to Stefan Mielke @@ -183,15 +213,14 @@ public function main(string $content, array $conf):string } //Iterate through the user's accepted languages foreach ($acceptedLanguagesArr as $currentLanguage) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Testing language: ' . $currentLanguage, $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Testing language: ' . $currentLanguage); + //If the current language is available (full "US_en" type check) if (isset($availableLanguagesArr[$currentLanguage])) { $preferredLanguageOrPageUid = $availableLanguagesArr[$currentLanguage]; - if (TYPO3_DLOG) { - GeneralUtility::devLog('Found: ' . $preferredLanguageOrPageUid . ' (full check)', $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Found: ' . $preferredLanguageOrPageUid . ' (full check)'); break; } @@ -211,9 +240,8 @@ public function main(string $content, array $conf):string $currentLanguageShort = substr($currentLanguage, 0, 2); if (isset($availableLanguagesArr[$currentLanguageShort])) { $preferredLanguageOrPageUid = $availableLanguagesArr[$currentLanguageShort]; - if (TYPO3_DLOG) { - GeneralUtility::devLog('Found: ' . $preferredLanguageOrPageUid . ' (normal check)', $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Found: ' . $preferredLanguageOrPageUid . ' (normal check)'); break; } } @@ -224,9 +252,8 @@ public function main(string $content, array $conf):string foreach ($values as $value) { if (isset($availableLanguagesArr[$value])) { $preferredLanguageOrPageUid = $availableLanguagesArr[$value]; - if (TYPO3_DLOG) { - GeneralUtility::devLog('Found: ' . $preferredLanguageOrPageUid . ' (alias check)', $this->extKey); - } + + $this->customLogger->info($this->extKey . ' Found: ' . $preferredLanguageOrPageUid . ' (alias check)'); break 2; } } @@ -246,26 +273,18 @@ public function main(string $content, array $conf):string $pathToDatabase = GeneralUtility::getFileAbsFileName($this->conf['pathToDatabaseForGeoIPData']); $geoIp = new \Net_GeoIP($pathToDatabase); // Get country code from geoip - if (TYPO3_DLOG) { - GeneralUtility::devLog('IP: ' . $this->getUserIP(), $this->extKey); - } + $this->customLogger->info($this->extKey . ' IP: ' . $this->getUserIP()); $countryCode = strtolower($geoIp->lookupCountryCode($this->getUserIP())); - if (TYPO3_DLOG) { - GeneralUtility::devLog('GeoIP Country Code: ' . $countryCode, $this->extKey); - } + $this->customLogger->info($this->extKey . ' GeoIP Country Code: ' . $countryCode); unset($geoIp); } // PHP module geoip if (!$countryCode && function_exists('geoip_country_code_by_name')) { // Get country code from geoip - if (TYPO3_DLOG) { - GeneralUtility::devLog('IP: ' . $this->getUserIP(), $this->extKey); - } + $this->customLogger->info($this->extKey . ' IP: ' . $this->getUserIP()); $countryCode = geoip_country_code_by_name($this->getUserIP()); - if (TYPO3_DLOG) { - GeneralUtility::devLog('GeoIP Country Code: ' . $countryCode, $this->extKey); - } + $this->customLogger->info($this->extKey . ' GeoIP Country Code: ' . $countryCode); } if ($countryCode) { @@ -275,23 +294,17 @@ public function main(string $content, array $conf):string if (array_key_exists($countryCode, $this->conf['countryCodeToLanguageCode.']) && array_key_exists($this->conf['countryCodeToLanguageCode.'][$countryCode], $availableLanguagesArr) ) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Available language found in configured: ' . $countryCode, $this->extKey); - } + $this->customLogger->info($this->extKey . ' Available language found in configured: ' . $countryCode); $preferredLanguageOrPageUid = $availableLanguagesArr[$this->conf['countryCodeToLanguageCode.'][$countryCode]]; //Use the static_info_tables lg_collate_locale to attempt to find a country to language relation. } elseif (ExtensionManagementUtility::isLoaded('static_info_tables')) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Checking in static_info_tables.', $this->extKey); - } + $this->customLogger->info($this->extKey . ' Checking in static_info_tables.'); //Get the language codes from lg_collate_locate $values = $this->getLanguageCodesForCountry($countryCode); foreach ($values as $value) { //If one of the languages exist if (array_key_exists($value, $availableLanguagesArr)) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Found in static_info_tables: ' . $value, $this->extKey); - } + $this->customLogger->info($this->extKey . ' Found in static_info_tables: ' . $value); $preferredLanguageOrPageUid = $availableLanguagesArr[$value]; break; } @@ -317,9 +330,7 @@ public function main(string $content, array $conf):string } } - if (TYPO3_DLOG) { - GeneralUtility::devLog('END result: Preferred=' . $preferredLanguageOrPageUid, $this->extKey); - } + $this->customLogger->info($this->extKey . ' END result: Preferred=' . $preferredLanguageOrPageUid); if ($preferredLanguageOrPageUid !== false) { $this->doRedirect((int)$preferredLanguageOrPageUid, $referrer); @@ -400,13 +411,9 @@ protected function doRedirect(int $preferredLanguageOrPageUid, string $referrer) $this->getTSFE()->storeSessionData(); } - if (TYPO3_DLOG) { - GeneralUtility::devLog('Location to redirect to: ' . $locationURL, $this->extKey); - } + $this->customLogger->info($this->extKey . ' Location to redirect to: ' . $locationURL); if (!$this->conf['dieAtEnd'] && ($preferredLanguageOrPageUid || $this->conf['forceRedirect'])) { - if (TYPO3_DLOG) { - GeneralUtility::devLog('Perform redirect', $this->extKey); - } + $this->customLogger->info($this->extKey . ' Perform redirect'); header('Location: ' . $locationURL); header('Connection: close'); header('X-Note: Redirect by rlmp_language_detection (' . $referrer . ')'); @@ -474,8 +481,8 @@ protected function getSysLanguages():array ); while ($row = $this->getDB()->sql_fetch_assoc($res)) { - if (TYPO3_DLOG && !$row['isocode']) { - GeneralUtility::devLog('No ISO-code given for language with UID ' . $row['uid'], $this->extKey); + if (!$row['isocode']) { + $this->customLogger->info($this->extKey . ' No ISO-code given for language with UID ' . $row['uid']); } if (!empty($row['lg_country_iso_2'])) { $availableLanguages[trim(strtolower($row['lg_iso_2'] . '-' . $row['lg_country_iso_2']))] = (int)$row['uid']; From 874fbf7774865d9c791f20dfb1e0bce917fcd273 Mon Sep 17 00:00:00 2001 From: klange Date: Thu, 13 Jun 2019 10:48:52 +0200 Subject: [PATCH 4/8] [UPGRADE] fixed DB call --- Classes/LanguageDetection.php | 29 ++++++++++++++++++----------- composer.json | 3 ++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Classes/LanguageDetection.php b/Classes/LanguageDetection.php index bd511d7..f76f4d4 100644 --- a/Classes/LanguageDetection.php +++ b/Classes/LanguageDetection.php @@ -1,4 +1,6 @@ -conf['defaultLang']))] = 0; } - $res = $this->getDB()->exec_SELECTquery( - 'sys_language.uid, static_languages.lg_iso_2, static_languages.lg_country_iso_2', - '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') - ); + $res = $this->getQueryBuilder() + ->select('sys.uid', 'static.lg_iso_2', 'static.lg_country_iso_2') + ->from('sys_language', 'sys') + ->join('sys', 'static_languages', 'static', 'sys.static_lang_isocode = static.uid') + ->execute(); - while ($row = $this->getDB()->sql_fetch_assoc($res)) { + while ($row = \mysqli_fetch_assoc($res)) { if (!$row['isocode']) { $this->customLogger->info($this->extKey . ' No ISO-code given for language with UID ' . $row['uid']); } @@ -551,7 +557,7 @@ protected function getLanguageCodesForCountry(string $countryCode):array $staticInfoObj->init(); } $languages = $staticInfoObj->initLanguages( - ' lg_collate_locale LIKE \'%_' . $this->getDB()->quoteStr(strtoupper($countryCode), 'static_languages') . '\' ' + ' lg_collate_locale LIKE \'%_' . $this->getQueryBuilder()->quote(strtoupper($countryCode), MYSQLI_TYPE_STRING) . '\' ' ); return array_map('strtolower', array_keys($languages)); @@ -576,11 +582,12 @@ protected function getTSFE():TypoScriptFrontendController } /** - * @return DatabaseConnection + * @return QueryBuilder */ - protected function getDB():DatabaseConnection + protected function getQueryBuilder(): QueryBuilder { - return $GLOBALS['TYPO3_DB']; + return GeneralUtility::makeInstance(ConnectionPool::class) + ->getQueryBuilderForTable('sys_language'); } /** diff --git a/composer.json b/composer.json index c9d475b..4b6593e 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ ], "require": { "typo3/cms-core": "^9.5", - "sjbr/static-info-tables": "*" + "sjbr/static-info-tables": "*", + "ext-mysqli": "*" }, "replace": { "rlmp_lanugage_detection": "self.version", From 6889f1b11e0541fc4117792bb2c798de89d304d1 Mon Sep 17 00:00:00 2001 From: klange Date: Thu, 13 Jun 2019 10:50:36 +0200 Subject: [PATCH 5/8] [UPGRADE] removed deprecated mehtod calls on syssten objects --- Classes/LanguageDetection.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Classes/LanguageDetection.php b/Classes/LanguageDetection.php index f76f4d4..f084698 100644 --- a/Classes/LanguageDetection.php +++ b/Classes/LanguageDetection.php @@ -16,7 +16,6 @@ * The TYPO3 project - inspiring people to share! */ -use Cobweb\ExternalImport\Domain\Model\Data; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; use SJBR\StaticInfoTables\PiBaseApi; @@ -30,7 +29,6 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Page\PageRepository; use TYPO3\CMS\Frontend\Plugin\AbstractPlugin; -use TYPO3\CMS\Typo3DbLegacy\Database\DatabaseConnection; /** * Plugin 'Language Detection' for the 'rlmp_language_detection' extension. @@ -357,7 +355,7 @@ protected function doRedirect(int $preferredLanguageOrPageUid, string $referrer) } else { /** @var PageRepository $sys_page */ $sys_page = GeneralUtility::makeInstance(PageRepository::class); - $sys_page->init(0); + $sys_page->__call('init', [0]); $page = $sys_page->getPage($preferredLanguageOrPageUid); } $pageId = method_exists($this->getTSFE(), 'getRequestedId') ? $this->getTSFE()->getRequestedId() : $page['uid']; @@ -414,7 +412,7 @@ protected function doRedirect(int $preferredLanguageOrPageUid, string $referrer) $this->extKey . '_languageSelected', $this->conf['useOneTreeMethod'] ? $preferredLanguageOrPageUid : true ); - $this->getTSFE()->storeSessionData(); + $this->getTSFE()->fe_user->storeSessionData(); } $this->customLogger->info($this->extKey . ' Location to redirect to: ' . $locationURL); From 3f0c75a2162f3343f0f0c937962d6febe6c0b304 Mon Sep 17 00:00:00 2001 From: klange Date: Thu, 13 Jun 2019 11:00:05 +0200 Subject: [PATCH 6/8] [UPGRADE] removed deprecated "Disable USER_INT when GP:L exists," --- Configuration/TypoScript/setup.txt | 101 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt index 7d4f093..fff3ed5 100644 --- a/Configuration/TypoScript/setup.txt +++ b/Configuration/TypoScript/setup.txt @@ -1,55 +1,50 @@ plugin.tx_rlmplanguagedetection_pi1 = USER_INT plugin.tx_rlmplanguagedetection_pi1 { - userFunc = Rlmp\RlmpLanguageDetection\LanguageDetection->main - - defaultLang = - useOneTreeMethod = 1 - cookieLifetime = 0 - multipleTreesRootPages { - - } - dontAddSchemeToURL = 0 - - useOldOneTreeConcept = 0 - - languageGPVar = L - - useLanguageAliases = 1 - languageAliases { - no = dk,sv - dk = no,sv - sv = no,dk - } - - countryCodeToLanguageCode { - us = en - gb = en - nz = en - au = en - ie = en - ca = en - de = de - at = de - ch = de - lu = de - li = de - se = sv - ua = ru - by = ru - } - - limitToLanguages = - excludeLanguages = - - dontBreakIfLanguageIsAlreadySelected = 0 - dontBreakIfLastPageWasOnSite = 0 - - testOrder = browser,ip - dieAtEnd = 0 - forceRedirect = 0 -} - -# Disable USER_INT when GP:L exists, and the extension anyway isn't needed. -[globalVar=GP:L=0,GP:L>0] - plugin.tx_rlmplanguagedetection_pi1 > -[global] + userFunc = Rlmp\RlmpLanguageDetection\LanguageDetection->main + + defaultLang = + useOneTreeMethod = 1 + cookieLifetime = 0 + multipleTreesRootPages { + + } + dontAddSchemeToURL = 0 + + useOldOneTreeConcept = 0 + + languageGPVar = L + + useLanguageAliases = 1 + languageAliases { + no = dk,sv + dk = no,sv + sv = no,dk + } + + countryCodeToLanguageCode { + us = en + gb = en + nz = en + au = en + ie = en + ca = en + de = de + at = de + ch = de + lu = de + li = de + se = sv + ua = ru + by = ru + } + + limitToLanguages = + excludeLanguages = + + dontBreakIfLanguageIsAlreadySelected = 0 + dontBreakIfLastPageWasOnSite = 0 + + testOrder = browser,ip + dieAtEnd = 0 + forceRedirect = 0 +} \ No newline at end of file From 279b96f21c09777112ab895304442b44aee14c68 Mon Sep 17 00:00:00 2001 From: klange Date: Thu, 13 Jun 2019 11:00:20 +0200 Subject: [PATCH 7/8] [UPGRADE] added info for v9 compatibility --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 788a4f4..8fad4d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ rlmp_language_detection ======================= +Changes for version 9.0.0 +------------------------- + +TYPO3 CMS 9 compatibility + +**ATTENTION:** The plugin is not automatically registered to your PAGE object anymore, do that manually where needed. +See manual! + +* Fixed DB calls +* Fixed system internals calls + Changes for version 7.0.0 ------------------------- From 6e0409d5f4501b71604f8eb7ced52dfe1b10d636 Mon Sep 17 00:00:00 2001 From: klange Date: Fri, 14 Jun 2019 08:55:30 +0200 Subject: [PATCH 8/8] [UPGRADE] fixed redirect loop and db result iteration --- Classes/LanguageDetection.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Classes/LanguageDetection.php b/Classes/LanguageDetection.php index f084698..dd3fd41 100644 --- a/Classes/LanguageDetection.php +++ b/Classes/LanguageDetection.php @@ -159,11 +159,14 @@ public function main(string $content, array $conf):string // If session key exists but no language GP var - // we should redirect client to selected language if (isset($languageSessionKey)) { - // Can redirect only in one tree method for now - if ($this->conf['useOneTreeMethod'] && is_numeric($languageSessionKey)) { - $this->doRedirect((int)$languageSessionKey, $referrer); - return ''; + if($languageSessionKey !== $GLOBALS['TYPO3_REQUEST']->getAttribute('language')->getLanguageId()){ + // Can redirect only in one tree method for now + if ($this->conf['useOneTreeMethod'] && is_numeric($languageSessionKey)) { + $this->doRedirect((int)$languageSessionKey, $referrer); + + return ''; + } } return $content; @@ -416,11 +419,15 @@ protected function doRedirect(int $preferredLanguageOrPageUid, string $referrer) } $this->customLogger->info($this->extKey . ' Location to redirect to: ' . $locationURL); + if (!$this->conf['dieAtEnd'] && ($preferredLanguageOrPageUid || $this->conf['forceRedirect'])) { + $this->customLogger->info($this->extKey . ' Perform redirect'); header('Location: ' . $locationURL); header('Connection: close'); + header('X-' . $this->extKey . ': Redirected'); header('X-Note: Redirect by rlmp_language_detection (' . $referrer . ')'); + } if ($preferredLanguageOrPageUid) { @@ -478,13 +485,15 @@ protected function getSysLanguages():array $availableLanguages[trim(strtolower($this->conf['defaultLang']))] = 0; } - $res = $this->getQueryBuilder() + $rows = $this->getQueryBuilder() ->select('sys.uid', 'static.lg_iso_2', 'static.lg_country_iso_2') ->from('sys_language', 'sys') ->join('sys', 'static_languages', 'static', 'sys.static_lang_isocode = static.uid') - ->execute(); + ->execute() + ->fetchAll(\Doctrine\DBAL\FetchMode::ASSOCIATIVE); + + foreach ($rows as $row) { - while ($row = \mysqli_fetch_assoc($res)) { if (!$row['isocode']) { $this->customLogger->info($this->extKey . ' No ISO-code given for language with UID ' . $row['uid']); }