$fieldConfig) { if (!isset($result['defaultLanguageRow'][$fieldName])) { // No default value available for this field continue; } if (!GeneralUtility::inList(($result['processedTca']['columns'][$fieldName]['l10n_display'] ?? ''), 'defaultAsReadonly')) { // defaultAsReadonly is not set for this field continue; } $languageField = (string)($result['processedTca']['ctrl']['languageField'] ?? ''); $transOrigPointerField = (string)($result['processedTca']['ctrl']['transOrigPointerField'] ?? ''); if ($languageField === '' || $transOrigPointerField === '' || !($result['databaseRow'][$languageField] ?? false) || !($result['databaseRow'][$transOrigPointerField] ?? false) ) { // The current record is not an overlay. Note: This check might already have taken place // while creating the default language row. However, since this field might be set by // other data providers unintentional, we check this here again to be sure. continue; } if ((int)$result['databaseRow'][$transOrigPointerField] !== (int)$result['defaultLanguageRow']['uid']) { // The current records "transOrigPointerField" doesn't point to the current default language row continue; } // Override the current database field with the one from the default language $result['databaseRow'][$fieldName] = $result['defaultLanguageRow'][$fieldName]; } return $result; } }