/** * Processes fields of a record for the publishing/swapping process. * Basically this takes care of IRRE (type "inline") child references. * * @param string $tableName Table name * @param string $fieldName: Field name * @param array $configuration TCA field configuration * @param array $liveData: Live record data * @param array $versionData: Version record data * @param DataHandler $dataHandler Calling data-handler object * @return void */ protected function version_swap_processFields($tableName, $fieldName, array $configuration, array $liveData, array $versionData, DataHandler $dataHandler) { $inlineType = $dataHandler->getInlineFieldType($configuration); if ($inlineType !== 'field') { return; } $foreignTable = $configuration['foreign_table']; // Read relations that point to the current record (e.g. live record): $liveRelations = $this->createRelationHandlerInstance(); $liveRelations->setWorkspaceId(0); $liveRelations->start('', $foreignTable, '', $liveData['uid'], $tableName, $configuration); // Read relations that point to the record to be swapped with e.g. draft record): $versionRelations = $this->createRelationHandlerInstance(); $versionRelations->setUseLiveReferenceIds(false); $versionRelations->start('', $foreignTable, '', $versionData['uid'], $tableName, $configuration); // Update relations for both (workspace/versioning) sites: if (count($liveRelations->itemArray)) { $dataHandler->addRemapAction($tableName, $liveData['uid'], array($this, 'updateInlineForeignFieldSorting'), array($tableName, $liveData['uid'], $foreignTable, $liveRelations->tableArray[$foreignTable], $configuration, $dataHandler->BE_USER->workspace)); } if (count($versionRelations->itemArray)) { $dataHandler->addRemapAction($tableName, $liveData['uid'], array($this, 'updateInlineForeignFieldSorting'), array($tableName, $liveData['uid'], $foreignTable, $versionRelations->tableArray[$foreignTable], $configuration, 0)); } }