public function getFlexFormDS_postProcessDS(&$dataStructArray, $conf, &$row, $table, $fieldName)
{
if (empty($fieldName) === TRUE) {
// Cast NULL if an empty but not-NULL field name was passed. This has significance to the Flux internals in
// respect to which ConfigurationProvider(s) are returned.
$fieldName = NULL;
}
if (!empty($fieldName) && !isset($row[$fieldName])) {
// Patch required (possibly temporary). Due to changes in TYPO3 in the new FormEngine we must fetch the
// database record at this point when the record is incomplete, which happens when attempting to render
// IRRE records. The reason is that the controller that creates the HTML does not fetch the record any
// more - and that the AJAX request contains only the UID. So, we fetch the record here to ensure it
// contains the necessary fields. DOES NOT WORK FOR NEW RECORDS - SEE COMMENTS BELOW.
$row = $this->recordService->getSingle($table, '*', $row['uid']);
}
$defaultDataSourceCacheIdentifier = $table . '_' . $fieldName . '_' . sha1(serialize($conf));
if (!$row) {
// In the case that the database record cannot be fetched we are dealing with a new or otherwise deleted
// or unidentifiable record. This happens primarily when AJAX requests are made to render IRRE records
// without the parent record having been saved first. To accommodate this case we have to be slightly
// creative and store a "default" data source definition which is identified based on a checksum of the
// configuration provided. Whenever we are then unable to fetch a record, we can at least attempt to
// locate a default data source in previously cached content. NB: we enforce a VERY high cache lifetime
// and continually refresh it every time it is possible to render a new DS that can serve as default.
$dataStructArray = (array) $this->cache->get($defaultDataSourceCacheIdentifier);
} else {
if (FALSE === is_array($dataStructArray)) {
$dataStructArray = array();
}
$providers = $this->configurationService->resolveConfigurationProviders($table, $fieldName, $row);
foreach ($providers as $provider) {
$provider->postProcessDataStructure($row, $dataStructArray, $conf);
}
if (empty($dataStructArray)) {
$dataStructArray = array('ROOT' => array('el' => array()));
}
$evaluationParameters = array();
$this->cache->set($defaultDataSourceCacheIdentifier, $this->recursivelyEvaluateClosures($dataStructArray, $evaluationParameters), array(), time() + 31536000);
}
// Trigger TCEforms dimension patching only if required by TYPO3 version according to CompatibilityRegistry.
if (CompatibilityRegistry::get('FluidTYPO3\\Flux\\Backend\\DynamicFlexForm::NEEDS_TCEFORMS_WRAPPER')) {
$dataStructArray = $this->patchTceformsWrapper($dataStructArray);
}
}