Bug #95628
closedNewContentElementController's "saveAndClose" functionality does create content elements with setting pi_flexform in tt_content to null
0%
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,
]);
}
Updated by Denis Mir about 3 years ago
- Subject changed from NewContentElementController's "saveAndClose" functionality does create content elements with setting pi_flexform to null to NewContentElementController's "saveAndClose" functionality does create content elements with setting pi_flexform in tt_content to null
Updated by Georg Ringer 6 months ago
- Is duplicate of Bug #91997: New content element wizard - saveAndClose - pi_flexform added
Updated by Georg Ringer 6 months ago
- Status changed from New to Closed
closing as duplicate of #91997 - an alternative way how to add flexforms is linked there as well