Skip to content

Commit

Permalink
[BUGFIX] v8: Sections working with localization
Browse files Browse the repository at this point in the history
Allow strings in container index value (needed for the Ajax).
This change is also needed for other templating systems later.

Thanks @Neowar for the deep analysies of this part.

Resolves: #109
  • Loading branch information
Alexander Opitz authored and opi99 committed Mar 1, 2018
1 parent e272544 commit 2b3834d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/FrontendController.php
Expand Up @@ -570,6 +570,7 @@ public function processDataValues(&$dataValues, $DSelements, $TOelements, $value
}
}
}
$dataValues[$key]['el']['__SECTION'] = true;
} else {
$this->processDataValues($dataValues[$key]['el'], $DSelements[$key]['el'], $TOelements[$key]['el'], $valueKey);
}
Expand Down
12 changes: 8 additions & 4 deletions Classes/Domain/Model/HtmlMarkup.php
Expand Up @@ -601,18 +601,22 @@ public function mergeFormDataIntoTemplateStructure(
) {
$isSection = 0;
$htmlParse = ($this->htmlParse ? $this->htmlParse : GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class));
if (is_array($editStruct) && count($editStruct)) {
$testInt = implode('', array_keys($editStruct));
$isSection = !preg_match('/[^0-9]/', $testInt);
if (is_array($editStruct) && isset($editStruct['_SECTION']) && $editStruct['_SECTION'] === true) {
$isSection = true;
}

$out = '';
if ($isSection) {
foreach ($editStruct as $section) {
foreach ($editStruct as $key => $section) {
if ($key === '__SECTION') {
continue;
}
if (is_array($section)) {
$secKey = key($section);
$secDat = $section[$secKey];
if ($currentMappingInfo['sub'][$secKey]) {
$out .= $this->mergeFormDataIntoTemplateStructure($secDat['el'], $currentMappingInfo['sub'][$secKey], '', $valueKey);
var_dump($out);
}
}
}
Expand Down

0 comments on commit 2b3834d

Please sign in to comment.