Feature #91419
openDisable caching on a per form basis
0%
Description
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:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['Form']['plugins']['Formframework']['controllers'][\TYPO3\CMS\Form\Controller\FormFrontendController::class]['nonCacheableActions'][] = 'render';
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:
tt_content.form_formframework.20 = USER_INT
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.
Updated by Martin Schulz over 2 years ago
Any news here? Iam on 10.4 building some forms that do prefilling by current fe_user?
Updated by Björn Jacob over 2 years ago
- Status changed from New to Closed
Thanks for your contribution :) We are working on a solution which will also be available for v10. Please see #93887 and #92406 / https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460/. I am closing this issue since the patch will fix your problem.
Updated by Björn Jacob over 2 years ago
- Related to Bug #93887: Ext:Form Caching Determination breaking Ajax Request added
Updated by Björn Jacob over 2 years ago
- Related to Bug #92406: Using formvh:render without extbase context results in Exception added
Updated by Gerrit Code Review over 2 years ago
- Status changed from Closed to Under Review
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460
Updated by Gerrit Code Review over 2 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70460
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70587
Updated by Simon Schaufelberger over 2 years ago
- Subject changed from Disable caching on a per form basis. to Disable caching on a per form basis
I'm also affected by this bug as I have a prefill typoscript config when logged in with data from fe_user.
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70587
Updated by Tim Obert almost 2 years ago
Any news here?
It seems that the patch is not compatible to the current state of the repo anymore and the workaround with "TYPO3_CONF_VARS" also doesn't seem to help.
Updated by Björn Jacob almost 2 years ago
We are still working on this issue. ATM there is another core sprint. The changes are rather complex.
Updated by Alexander Grein 9 months ago
The workaround to set `tt_content.form_formframework.20 = USER_INT` is not working under TYPO3 12, since it uses an EXTBASEPLUGIN content object now.
Disabling caching for all forms, feels very crude.