Issue Feature Under Review Orphaned

#91419Disable caching on a per form basis

Jarvis H 05/16/20, 15:47 updated 10/31/25, 10:37

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.

Reviews 2

History 1519

  1. Martin Schulz commented <span data-processor="relativetime" data-value="2021-08-13T12:49:30+00:00" > 08/13/21, 12:49 </span>

    Any news here? Iam on 10.4 building some forms that do prefilling by current fe_user?

  2. Björn Jacob commented and changed status New Closed <span data-processor="relativetime" data-value="2021-08-13T16:05:19+00:00" > 08/13/21, 16:05 </span>

    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.

  3. Gerrit Code Review pushed patch set 13 for master to change 70460 status Closed Under Review <span data-processor="relativetime" data-value="2021-08-13T17:19:25+00:00" > 08/13/21, 17:19 </span>

  4. Simon Schaufelberger commented and changed subject Disable caching on a per form basis. Disable caching on a per form basis <span data-processor="relativetime" data-value="2021-10-28T21:50:32+00:00" > 10/28/21, 21:50 </span>

    I’m also affected by this bug as I have a prefill typoscript config when logged in with data from fe_user.

  5. Tim Obert commented <span data-processor="relativetime" data-value="2022-06-29T14:10:49+00:00" > 06/29/22, 14:10 </span>

    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.

  6. Björn Jacob commented <span data-processor="relativetime" data-value="2022-06-29T15:17:51+00:00" > 06/29/22, 15:17 </span>

    We are still working on this issue. ATM there is another core sprint. The changes are rather complex.

  7. Alexander Grein commented <span data-processor="relativetime" data-value="2023-08-04T09:33:20+00:00" > 08/04/23, 09:33 </span>

    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.

  8. André Buchmann commented <span data-processor="relativetime" data-value="2024-08-20T13:47:00+00:00" > 08/20/24, 13:47 </span>

    Due to the switch from USER to EXTBASEPLUGIN the simple switch to USER_INT is not working anymore directly as Alexander Grein already stated.

    For TYPO3 12 & 13 you need to add the userFunc definition back in to get it working:

    tt_content.form_formframework.20 = USER_INT
    tt_content.form_formframework.20.userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run

    Still this is only a workaround and I would like to have a feature to disable the cache for a single form/form element. Here is my usecase:

    Customers get indiviualized links to a form. The GET param is automatically prefilled in a field.
    Custom typoscript only on the special form page to read the GET param (?foo=bar). The GET param is excluded from the chash generation ([FE][cacheHash][excludedParameters])

    plugin.tx_form.settings {
        formDefinitionOverrides {
            // form identifier:
            test {
                renderables {
                    // identifier: page-1
                    0 {
                        renderables {
                            // identifier: text-1
                            0 {
                                defaultValue = TEXT
                                defaultValue.data = gp:foo
                            }
                        }
                    }
                }
            }
        }
    }
    
    // Disable caching for the form
    tt_content.form_formframework.20 = USER_INT
    tt_content.form_formframework.20.userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run

    When the cache is enabled the first param value is cached for all other calls. Can’t have that for the personlized codes in my project :-)

  9. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-08-20T17:09:34+00:00" > 08/20/24, 17:09 </span>

    Don’t hit me, but how about utilizing JavaScript to read the GET params and fill specific fields?

    Then everything could be cached and you wouldn’t need that custom form typoscript reading values…?

  10. Simon Schaufelberger commented <span data-processor="relativetime" data-value="2024-08-20T20:00:32+00:00" > 08/20/24, 20:00 </span>

    For me that JavaScript solution wouldn’t work. I’m reading values from the feusers table and fill it in

  11. Stefan Froemken commented <span data-processor="relativetime" data-value="2025-10-31T10:37:23+00:00" > 10/31/25, 10:37 </span>

    I just tried following and it works:

    tt_content.form_formframework.20 = COA_INT
    tt_content.form_formframework.20 {
      10 = EXTBASEPLUGIN
      10 {
        extensionName = Form
        pluginName = Formframework    
      }
    }

    On core side I think of EXTBASEPLUGIN_INT