Project

General

Profile

Actions

Bug #95853

closed

DI in form finishers is not working

Added by Elias Häußler over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2021-11-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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

  1. Generate new form or modify existing form
  2. Add `ConfirmationFinisher` with finisher option `contentElementUid`
  3. Try to send form in Frontend
  4. You should get an exception `TypoScript object path "lib.tx_form.contentElementRendering" does not exist`

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #95540: tx_form ConfirmationFinisher does not execute the methods injectConfigurationManager and injectContentObjectRendererClosed2021-10-08

Actions
Related to TYPO3 Core - Task #94317: Avoid ObjectManager around ext:form FormDefinitionClosed2021-06-11

Actions
Actions #1

Updated by Gerrit Code Review over 2 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

Actions #2

Updated by Torben Hansen over 2 years ago

  • Related to Bug #95540: tx_form ConfirmationFinisher does not execute the methods injectConfigurationManager and injectContentObjectRenderer added
Actions #3

Updated by Gerrit Code Review over 2 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

Actions #4

Updated by Gerrit Code Review over 2 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

Actions #5

Updated by Gerrit Code Review over 2 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

Actions #6

Updated by Anonymous over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Elias Häußler over 2 years ago

  • Related to Task #94317: Avoid ObjectManager around ext:form FormDefinition added
Actions #8

Updated by Katharina Strasser almost 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);

        ...

    }
Actions #9

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF