Bug #95853
closedDI in form finishers is not working
100%
Description
Problem¶
Since #94317 dependency injection for form finishers no longer works. This is due to the fact that finishers are now constructed by GeneralUtility::makeInstance
. Since the finisher services are not public, dependencies are not getting injected anymore.
Possible solution¶
Make form finishers public by default, e.g. by using the PublicServicePass
.
Steps to reproduce¶
- Generate new form or modify existing form
- Add `ConfirmationFinisher` with finisher option `contentElementUid`
- Try to send form in Frontend
- You should get an exception `TypoScript object path "lib.tx_form.contentElementRendering" does not exist`
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
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/+/72027
Updated by Torben Hansen almost 3 years ago
- Related to Bug #95540: tx_form ConfirmationFinisher does not execute the methods injectConfigurationManager and injectContentObjectRenderer added
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 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/+/72027
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 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/+/72027
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 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/+/72027
Updated by Anonymous almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7c0dac581facccbd1efde5fd725de848e04a4b83.
Updated by Elias Häußler almost 3 years ago
- Related to Task #94317: Avoid ObjectManager around ext:form FormDefinition added
Updated by Katharina Strasser about 2 years ago
This still happens is 11.5.12
I had to add this to my overwrite:
protected function executeInternal()
{
//fix for: https://forge.typo3.org/issues/95853
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$this->typoScriptSetup = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$this->contentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
...
}