Issue Bug Closed

#101635InstallTool not accessible on TYPO3 v12.4 update

Ingo Hollmann 08/09/23, 12:36 updated 12/02/25, 14:37

Description

Trying to update an existing TYPO3 Version I stumbled accross a Problem with FormProtection. We have a dev-envirment configured to use the NullBackend for all cachetypes via:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['backend'] = \TYPO3\CMS\Core\Cache\Backend\NullBackend::class;

After Update neither the InstallTool nor the Backend is working anymore.

TYPO3\CMS\Core\FormProtection\FormProtectionFactory::createForType(): Return value must be of type TYPO3\CMS\Core\FormProtection\AbstractFormProtection, bool returned

This is comming from here:

https://github.com/TYPO3/typo3/blob/3c9ad409dd55fe8ff6a003f927b7399e992d1ee4/typo3/sysext/core/Classes/FormProtection/FormProtectionFactory.php#L84

Disabling the use of NullBackend helps.
A possible solution is this;

# diff FormProtectionFactory.php FixedFormProtectionFactory.php 
68,69c68,70
<         $this->runtimeCache->set($identifier, $this->createInstance(...$classNameAndConstructorArguments));
<         return $this->runtimeCache->get($identifier);
---
>         $instance = $this->createInstance(...$classNameAndConstructorArguments)
>         $this->runtimeCache->set($identifier, $instance);
>         return $instance;
83,84c84,86
<         $this->runtimeCache->set($identifier, $this->createInstance(...$classNameAndConstructorArguments));
<         return $this->runtimeCache->get($identifier);
---
>         $instance = $this->createInstance(...$classNameAndConstructorArguments);
>         $this->runtimeCache->set($identifier, $instance);
>         return $instance;

Reviews 4