flexform data is not deleted when changing plugin
Changing the selected plugin in a content element, where the former plugin had a flexform configuration, but the new plugin does not have one must remove the existing configuration, otherwise the old configuration is still applied to the new plugin.
Another option would be to simply ignore the existing flexform data if the current plugin does not require them.
Updated by Claus Due over 5 years ago
Don't forget about the "clean flexform data" toggle which when enabled will analyse the DS and remove any data in the XML representation that is NOT also defined in the DS.
It has side effects but it is already there. I'm not sure it should become the default...
Updated by Sybille Peters about 5 years ago
Claus, can you please clarify what you mean by "clean flexform data" toggle? Is there an extra configuration option?
I could not find it. What is usually recommended on removing or changing flexform data is to use the lowlevel cleaner which internally uses the function cleanFlexFormXML in FlexFormTools.
Updated by Stefan P almost 3 years ago
We run into this very problem every now and then. Wouldn't it be possible to just respect the flexform if it's actually defined for the plugin? If a plugin configuration has no FlexForm registered just don't parse it. It's registered if
the array keys of
GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'] contain the plugin signature and if the file actually exists. Just check for this before loading the Flexform and this ticket is solved, isn't it?
No need to clear the actual DB field content on CType/list_type change then.