Bug #60399
closedrte_transform "db" is not applied to RTE-fields defined via "foreign_types" / palettes
100%
Description
Scenario:
I needed an RTE-field for sys_file_reference, so i created one the usual way (defaultExtras, softref ...).
Then i created a custom palette for sys_file_reference and added the fields i needed to it. This palette is used via ExtensionManagementUtility::getFileFieldTCAConfig() and "foreign_types" in a tt_content FAL-relation field.
Problem:
Visually there are no problems while editing the FAL elements within the tt_content elements. The text added to the RTE field is visible in frontend, but the rte_transform stuff with direction "db" was never applied to the RTE field before saving the data to DB - which leads e.g. to the very messy problem, that all links created with the link wizard will be stored as "a" elements with absolute URLs and not as internal "link" elements.
Way to a solution:
To hotfix this i found out that BackendUtility::getTCAtypes() used in
DataHandler->fillInFieldArray() does not return useful field information. It returns the showitem definition of the original "types" array of the sys_file_reference TCA, which contains no fields at all.
My hotfix just checks "$incomingFieldArrayKeys" in DataHandler->fillInFieldArray() for "_TRANSFORM_"-fields and adds the required field definition to "$types_fieldConfig" if it´s missing there.
For a cleaner solution the "foreign_types" have to be considered and there fields extracted - but i was not able to spot logic that does s.th. like this.
Files