Current Behavior
We've extended the news flexform using a dedicated hook for FlexFormTools, registered within $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing']. This works fine and the additional fields are shown in FormEngine.
It obviously does not include additional fields added via hooks and therefore removes all of them.
Expected behavior/output
It would be nice if additional fields registered via flexform hooks can be taken into account when cleaning up flexform XMLs. This would avoid additional fields from getting removed, leading to a potential change in behavior (depending on what additional fields are configured and what impact they have).
Environment
TYPO3 version(s): 11.5.30
news version: 11.1.2
Is your TYPO3 installation set up with Composer (Composer Mode): yes
OS: macOS 13.4.1
Possible Solution
I have a working solution in place which uses TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::cleanFlexFormXML() to clean up the flexform XML. AFAICS, this method does a pretty similar job like GeorgRinger\News\Updates\PluginUpdater:: getAllowedSettingsFromFlexForm(), but additionally calls all registered hooks. I'm not sure if this solution could be used as drop-in replacement for the current implementation, therefore I'm posting it here before submitting a PR. Please let me know if this is something you'd consider useful and I'd be happy to submit a PR.
Bug Report
Current Behavior We've extended the news flexform using a dedicated hook for
FlexFormTools
, registered within$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing']
. This works fine and the additional fields are shown in FormEngine.However, when running the
PluginUpdater
upgrade wizard, those fields get removed from thepi_flexform
values. This is because of the following method: https://github.com/georgringer/news/blob/a81398060ff206bc7c7c1aff4b148e2ceadc7499/Classes/Updates/PluginUpdater.php#L185It obviously does not include additional fields added via hooks and therefore removes all of them.
Expected behavior/output It would be nice if additional fields registered via flexform hooks can be taken into account when cleaning up flexform XMLs. This would avoid additional fields from getting removed, leading to a potential change in behavior (depending on what additional fields are configured and what impact they have).
Environment
Possible Solution I have a working solution in place which uses
TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::cleanFlexFormXML()
to clean up the flexform XML. AFAICS, this method does a pretty similar job likeGeorgRinger\News\Updates\PluginUpdater:: getAllowedSettingsFromFlexForm()
, but additionally calls all registered hooks. I'm not sure if this solution could be used as drop-in replacement for the current implementation, therefore I'm posting it here before submitting a PR. Please let me know if this is something you'd consider useful and I'd be happy to submit a PR.