Actions
Bug #95628
closedNewContentElementController's "saveAndClose" functionality does create content elements with setting pi_flexform in tt_content to null
Start date:
2021-10-13
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When using the `NewContentElementController` and its `saveAndClose` functionality, the `pi_flexform` field gets set to `null` although a flexform is defined for the specific content element. As opposed to not using the `saveAndClose` functionality and saving the content element manually which fills the `pi_flexform` field.
This is a problem due to defaults coming from this flexform field (that a template would use) not being available in the frontend template (or the processor processing the flexform). An editor has to manually reopen and save the content element to get the `pi_flexform` field correctly set.
This is the part of the code that leads to this behaviour:
if (($wInfo['saveAndClose'] ?? false)) {
$viewVariables['target'] = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [
'data' => [
'tt_content' => [
StringUtility::getUniqueId('NEW') => array_replace($defVals, [
'colPos' => $this->colPos,
'pid' => $this->uid_pid,
'sys_language_uid' => $this->sys_language,
]),
],
],
'redirect' => $this->R_URI,
]);
}
Actions