Skip to content
Snippets Groups Projects
Commit 3f36c7b8 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Fix writing of the form configurations if the folder is ḿissing, Fix...

[BUGFIX] Fix writing of the form configurations if the folder is ḿissing, Fix default form extension key to project_theme
parent df5c0d92
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ class FormsFinisher extends AbstractFinisher {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$mailTemplateService = $objectManager->get(
MailTemplateService::class, $templateName, 'sg_mail', $markers
MailTemplateService::class, $templateName, 'project_theme', $markers
);
$ignoreMailQueue = (boolean) $this->parseOption('ignoreMailQueue');
......
......@@ -249,15 +249,9 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface {
// get the location where registrations should be stored
$configurationLocation = $this->getRegistrationPath();
$registerFolder = GeneralUtility::getFileAbsFileName(
$configurationLocation
);
// create folder
GeneralUtility::mkdir($registerFolder);
$registerFile = GeneralUtility::getFileAbsFileName(
$registerFolder . '/' . $templateKey . '.php'
);
$registerFolder = GeneralUtility::getFileAbsFileName($configurationLocation);
GeneralUtility::mkdir_deep($registerFolder);
$registerFile = GeneralUtility::getFileAbsFileName($registerFolder . '/' . $templateKey . '.php');
// build the register array
$newRegisterArray = [
......@@ -282,4 +276,3 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface {
file_put_contents($registerFile, '<?php return ' . var_export($newRegisterArray, TRUE) . ';');
}
}
......@@ -91,7 +91,7 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
// retrieve the extension and template key and jump out of loop
$extensionKey = (string) $finisher['options']['extension'];
$extensionKey = $extensionKey ?: 'sg_mail';
$extensionKey = $extensionKey ?: 'project_theme';
$templateKey = str_replace('_', '-', $finisher['options']['template']);
// if no template key was explicitly set, use the form identifier as template key
......@@ -163,12 +163,8 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
private function writeRegisterFile(array $renderables, $extensionKey, $templateKey): string {
// get the location where automatic registrations should be stored
$configurationLocation = $this->getRegistrationPath();
$registerFolder = GeneralUtility::getFileAbsFileName(
$configurationLocation
);
GeneralUtility::mkdir($registerFolder);
$registerFolder = GeneralUtility::getFileAbsFileName($configurationLocation);
GeneralUtility::mkdir_deep($registerFolder);
$hashPrefix = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateKey . '.php');
$registerFile = GeneralUtility::getFileAbsFileName(
......@@ -186,8 +182,8 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
// add the markers for this template
foreach ($renderables as $element) {
$markerName = $element['identifier'];
// if markerName is explicitly set, override the registered identifier
$markerName = $element['identifier'];
if (isset($element['properties']['markerName']) && $element['properties']['markerName'] !== '') {
$markerName = $element['properties']['markerName'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment