2 declare(strict_types = 1);
42 SiteConfiguration::class,
54 public function addData(array $result): array
56 if ($result[
'command'] !==
'edit' || !empty($result[
'databaseRow'])) {
60 $tableName = $result[
'tableName'];
61 $siteFinder = GeneralUtility::makeInstance(SiteFinder::class, $this->siteConfiguration);
62 if ($tableName ===
'site') {
63 $rootPageId = (int)$result[
'vanillaUid'];
65 $result[
'databaseRow'][
'uid'] = $rowData[
'rootPageId'];
66 $result[
'databaseRow'][
'identifier'] = $result[
'customData'][
'siteIdentifier'];
67 } elseif (in_array($tableName, [
'site_errorhandling',
'site_language',
'site_route',
'site_base_variant'],
true)) {
68 $rootPageId = (int)($result[
'inlineTopMostParentUid'] ?? $result[
'inlineParentUid']);
70 $parentFieldName = $result[
'inlineParentFieldName'];
71 if (!isset($rowData[$parentFieldName])) {
72 throw new \RuntimeException(
'Field "' . $parentFieldName .
'" not found', 1520886092);
74 $rowData = $rowData[$parentFieldName][$result[
'vanillaUid']];
75 $result[
'databaseRow'][
'uid'] = $result[
'vanillaUid'];
77 throw new \RuntimeException(
'Other tables not implemented', 1520886234);
80 foreach ($rowData as $fieldName => $value) {
82 if (!is_array($value)) {
83 $result[
'databaseRow'][$fieldName] = $value;
87 $result[
'databaseRow'][
'pid'] = 0;
100 $configuration = $this->siteConfiguration->load($site->getIdentifier());
101 if (isset($configuration[
'site'])) {
103 'Site configuration with key \'site\' has been deprecated, remove indentation level and site key.',
106 $configuration = $configuration[
'site'];
108 return $configuration;