Project

General

Profile

Feature #91419

Updated by Simon Schaufelberger about 3 years ago

The form framework caches forms which causes issues when pre-filling fields with data. Any dynamic data retrieved via get params or database queries will be cached and can't be overridden until caches are deleted. 

 Current solutions found in the typo3 slack channel fx. include disabling caching completely for the render function in the form controller: 

 <pre> 
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['Form']['plugins']['Formframework']['controllers'][\TYPO3\CMS\Form\Controller\FormFrontendController::class]['nonCacheableActions'][] $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['Form']['plugins']['Formframework']['controllers']['FormFrontend']['nonCacheableActions'][] = 'render'; 
 </pre> 

 This of course changes caching for all forms which is not really an ideal solution. 

 Another solution suggested was using USER_INT instead of USER like this: 

 <pre> 
 tt_content.form_formframework.20 = USER_INT 
 </pre> 

 This would allow for disabling the cache on a per page basis. However certain forms which need to be uncached may be inserted by editors on multiple pages and makes it necessary to keep track of page ids where such forms are present and add them to our Typoscript. 

 It would be great to be able to disable caches for certain form configurations, perhaps as a yaml property. I am not sure if caches could be easily disabled via the form api in hooks where dynamic data is added, if this is the case that would also work for me.

Back