Commit b914f5eb authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Fix language and pid determination of fresh templates

parent 51931713
......@@ -142,7 +142,7 @@ class MailController extends AbstractController {
);
$template = GeneralUtility::makeInstance(Template::class);
$template->setSiteLanguage($language);
$template->setPid($this->getPid());
$templateFromFile['pid'] = $this->site->getRootPageId();
$this->templateRepository->fillTemplate(
$template,
$templateFromFile
......
......@@ -167,7 +167,7 @@ class NewsletterController extends AbstractController {
);
$template = GeneralUtility::makeInstance(Template::class);
$template->setSiteLanguage($selectedLanguage);
$template->setPid($this->getPid());
$templateFromFile['pid'] = $this->site->getRootPageId();
$this->templateRepository->fillTemplate($template, $templateFromFile);
} else {
$template->setIsOverwritten(TRUE);
......
......@@ -135,6 +135,7 @@ class TemplateRepository extends AbstractRepository {
$template->setTemplateName($templateData['templateName']);
$template->setLanguageUid($templateData['sys_language_uid']);
$template->setPid($templateData['pid']);
if ($templateData['layout']) {
$template->setLayout($templateData['layout']);
}
......
......@@ -33,6 +33,7 @@ use SGalinski\SgMail\Domain\Repository\TemplateRepository;
use Swift_Attachment;
use Symfony\Component\Mailer\Exception\TransportException;
use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
use TYPO3\CMS\Core\Resource\File;
......@@ -457,6 +458,7 @@ class MailTemplateService implements SingletonInterface {
$this->templateName,
$this->siteLanguage
);
$templateArray['pid'] = $this->pid;
$template = $this->getTemplateRepository()->create($templateArray);
}
......
......@@ -51,6 +51,15 @@ $columns = [
],
],
'columns' => [
'sys_language_uid' => [
'exclude' => TRUE,
'label' => 'EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages'
]
],
'status' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_mail/Resources/Private/Language/locallang_db.xlf:tx_sgmail_domain_model_mail.status',
......
......@@ -52,6 +52,15 @@ $columns = [
],
],
'columns' => [
'sys_language_uid' => [
'exclude' => TRUE,
'label' => 'EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages'
]
],
'hidden' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0',
......
......@@ -161,6 +161,7 @@
<div class="panel panel-default row">
<div class="panel-body">
<f:form.hidden name="parameters[templates][{languageId}][uid]" value="{template.uid}" />
<f:form.hidden name="parameters[templates][{languageId}][pid]" value="{template.pid}" />
<f:form.hidden name="parameters[templates][{languageId}][sys_language_uid]" value="{languageId}" />
<f:form.hidden name="parameters[templates][{languageId}][extensionKey]" value="{template.extensionKey}" />
<f:form.hidden name="parameters[templates][{languageId}][templateName]" value="{template.templateName}" />
......
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