Commit 2081985b authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing a language bug with backend filters and default language when sending

parent e641090c
......@@ -183,9 +183,9 @@ class BackendService {
$languages = [];
// adding default language
$languages[] = ['isocode' => LocalizationUtility::translate(
$languages[] = ['isocode' => MailTemplateService::DEFAULT_LANGUAGE, 'name' => LocalizationUtility::translate(
'backend.language_default', 'SgMail'
), 'name' => LocalizationUtility::translate('backend.language_default', 'SgMail')];
)];
foreach ($rows as $language) {
$languages[] = ['isocode' => $language['language_isocode'],
......@@ -220,6 +220,7 @@ class BackendService {
*/
public static function getLanguagesForFilter() {
$languages = self::getLanguages();
array_unshift($languages, ['isocode' => '', 'name' => '']);
$filterLanguages = [];
if (count($languages) > 0) {
......
......@@ -48,6 +48,7 @@ class MailTemplateService {
const MARKER_TYPE_STRING = 'String';
const MARKER_TYPE_ARRAY = 'Array';
const MARKER_TYPE_OBJECT = 'Object';
const DEFAULT_LANGUAGE = 'default';
/**
* @var array $registerArray
......@@ -304,7 +305,6 @@ class MailTemplateService {
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
public function sendEmail($isPreview = FALSE) {
if (TYPO3_MODE === 'FE') {
/** @var TypoScriptFrontendController $tsfe */
$tsfe = $GLOBALS['TSFE'];
......@@ -438,7 +438,7 @@ class MailTemplateService {
*/
private function addMailToMailQueue(
$extensionKey, $templateName, $subject, $emailBody, $priority, $sendingTime = 0,
$lastSendingTime = 0, $language = 'en', $pid = 0
$lastSendingTime = 0, $language = self::DEFAULT_LANGUAGE, $pid = 0
) {
$mail = $this->objectManager->get(Mail::class);
$mail->setPid($pid);
......
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