Commit 6f6968f0 authored by Georgi Mateev's avatar Georgi Mateev
Browse files

[BUGFIX] Fix code review issues and minor bugs

parent 88d51185
......@@ -116,7 +116,7 @@ class LicenceCheckService {
/**
* The current extension version
*/
const CURRENT_VERSION = '4.0';
const CURRENT_VERSION = '4.1';
/**
* @var array
......
......@@ -727,8 +727,8 @@ class StaticFileGenerationService implements SingletonInterface {
} else {
try {
$url = '/' . $this->removeCHashFromUrl(
$contentObject->getTypoLink_URL($uid, '&disableOptIn=1&L=' . $languageUid)
);
$contentObject->getTypoLink_URL($uid, '&disableOptIn=1&L=' . $languageUid)
);
$name = $contentObject->crop($pageData['title'], 35 . '|...|0');
} catch (\Exception $exception) {
// Occurs on the first creation of the translation.
......@@ -768,7 +768,9 @@ class StaticFileGenerationService implements SingletonInterface {
'disable_powered_by' => (boolean) $translatedData['disable_powered_by'],
'disable_for_this_language' => (boolean) $translatedData['disable_for_this_language'],
'set_cookie_for_domain' => (string) $translatedData['set_cookie_for_domain'],
'save_history_webhook' => (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 9000000) ? '/?eID=sg_cookie_optin_saveOptinHistory' : '/?saveOptinHistory',
'save_history_webhook' => (VersionNumberUtility::convertVersionNumberToInteger(
TYPO3_version
) < 9000000) ? '/?eID=sg_cookie_optin_saveOptinHistory' : '/?saveOptinHistory',
'cookiebanner_whitelist_regex' => (string) $translatedData['cookiebanner_whitelist_regex'],
'banner_show_again_interval' => (int) $translatedData['banner_show_again_interval'],
'identifier' => $this->siteRoot,
......@@ -863,7 +865,8 @@ class StaticFileGenerationService implements SingletonInterface {
$sitePath = defined('PATH_site') ? PATH_site : Environment::getPublicPath() . '/';
$file = $sitePath . $folder . str_replace(
'#LANG#', (($locale !== '') ? $locale : '') . JsonImportService::LOCALE_SEPARATOR . $translatedData['sys_language_uid'],
'#LANG#',
(($locale !== '') ? $locale : '') . JsonImportService::LOCALE_SEPARATOR . $translatedData['sys_language_uid'],
self::TEMPLATE_JSON_NAME
);
file_put_contents($file, json_encode($jsonDataArray, JSON_PRETTY_PRINT));
......
......@@ -92,7 +92,7 @@ class AddCookieOptinJsAndCss implements SingletonInterface {
if (!$jsonData['settings']['disable_for_this_language']) {
if ($jsonData['settings']['render_assets_inline']) {
return '<script id="cookieOptinData" type="application/json">' . json_encode($jsonData) .
'</script><script type="text/javascript" data-ignore="1">' . file_get_contents($sitePath . $file) . '</script>';
"</script>\n".'<script type="text/javascript" data-ignore="1">' . file_get_contents($sitePath . $file) . "</script>\n";
}
return '<script id="cookieOptinData" type="application/json">' . json_encode($jsonData) .
......@@ -153,7 +153,7 @@ class AddCookieOptinJsAndCss implements SingletonInterface {
if ($jsonFile) {
$jsonData = json_decode(file_get_contents($sitePath . $jsonFile), TRUE);
if ($jsonData['settings']['render_assets_inline']) {
return '<style>' . file_get_contents($sitePath . $file) . '</style>';
return '<style>' . file_get_contents($sitePath . $file) . "</style>\n";
}
}
......
......@@ -3,9 +3,13 @@ return [
'frontend' => [
'SGalinski/SgCookieOptin/saveOptinHistory' => [
'target' => \SGalinski\SgCookieOptin\Middlewares\SaveOptinHistory::class,
'after' => [
'typo3/cms-frontend/prepare-tsfe-rendering'
]
'after' => [
'typo3/cms-frontend/site-resolver',
],
'before' => [
'typo3/cms-frontend/base-redirect-resolver'
]
],
],
];
......@@ -14,8 +14,8 @@
<target><![CDATA[Es werden keine Parameter an den Server gesendet.]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline" approved="yes">
<source><![CDATA[Render CSS and JavaScript contents inline]]></source>
<target><![CDATA[CSS- und JavaScript-Inhalte inline rendern]]></target>
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
<target><![CDATA[CSS- und JavaScript-Inhalte inline rendern (kann sich negativ auf die Performance auswirken)]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track">
<source><![CDATA[Take DoNotTrack into account]]></source>
......
......@@ -13,7 +13,7 @@
<source><![CDATA[No parameters sent to the server.]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline">
<source><![CDATA[Render CSS and JavaScript contents inline]]></source>
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track">
<source><![CDATA[Take DoNotTrack into account]]></source>
......
Supports Markdown
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