Issue Feature Closed

#106456Allow to modify excludeFields and overrideValues in DataHandler->copyRecord

Torben Hansen 03/29/25, 11:44 updated 04/21/26, 11:30

Description

The DataHandler function copyRecord has the parameter $excludeFields, which allows to define fields which are ignored when a record is copied. It is not possible to define a default or modify the $excludeFields parameter, so DataHandler will always copy all fields. In some scenarios, it might however be useful, to exclude some fields from the copy process (e.g. inline field values not suitable for the copy process). Additionally it might be useful to modify overrideValues before record field values are processed (e.g. add custom prefix or set field to a default value).

For scenarios, where a main record is localizable and possible inline records are not, DataHandler will use copyRecord on localization of the main record, resulting in a Localization failed; "languageField" and "transOrigPointerField" must be defined for the table tx_myextension_domain_model_table warning for each non localizable child record. This warning can currently not be suppressed, because it is not possible to exclude a field from the localization process.

Reviews 1