Code Monkey home page Code Monkey logo

Comments (7)

sdelcroix avatar sdelcroix commented on August 26, 2024 1

If I understood what I've debugged, the sequence is :

  1. When FluidTYPO3\Flux\Service\TypoScriptService is injected early at boot, ChimeraConfigurationManager::initializeConcreteConfigurationManager(...) calls TYPO3\CMS\Extbase\Configuration\ConfigurationManager::initializeConcreteConfigurationManager(...)
  2. At this time $GLOBALS['TYPO3_REQUEST'] is null, so Extbase ConfigurationManager instanciates a TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager as concreteConfigurationManager
  3. Later, in frontend, when dependency injection occurs for TYPO3\CMS\FrontendLogin\Configuration\RecoveryConfiguration, it uses the Extbase ConfigurationManager singleton instance and thus its concreteConfigurationManager
  4. As this concreteConfigurationManager is a TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager, it cannot retrieve the frontend plugin TS settings

from flux.

sdelcroix avatar sdelcroix commented on August 26, 2024

Follow up

I kept debugging and found that if I replace ConfigurationManager by ConfigurationManagerInterface in TYPO3\CMS\FrontendLogin\Configuration\RecoveryConfiguration::__construct , the felogin plugin settings are not empty.

Here is the dependency injection sequence with this change :

/**
     * Gets the private 'TYPO3\CMS\FrontendLogin\Service\RecoveryService' shared autowired service.
     *
     * @return \TYPO3\CMS\FrontendLogin\Service\RecoveryService
     */
    protected function getRecoveryServiceService()
    {
        $a = ($this->services['FluidTYPO3\\Flux\\Integration\\Overrides\\ChimeraConfigurationManager'] ?? ($this->services['FluidTYPO3\\Flux\\Integration\\Overrides\\ChimeraConfigurationManager'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\FluidTYPO3\Flux\Integration\Overrides\ChimeraConfigurationManager::class, $this)));

        $b = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\FrontendLogin\Configuration\RecoveryConfiguration::class, ($this->services['TYPO3\\CMS\\Core\\Context\\Context'] ?? $this->getContextService()), $a, ($this->privates['TYPO3\\CMS\\Core\\Crypto\\Random'] ?? ($this->privates['TYPO3\\CMS\\Core\\Crypto\\Random'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Core\Crypto\Random::class))), ($this->services['TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService'] ?? $this->getHashServiceService()));
        $b->setLogger(($this->services['_early.TYPO3\\CMS\\Core\\Log\\LogManager'] ?? $this->get('_early.TYPO3\\CMS\\Core\\Log\\LogManager', 1))->getLogger('TYPO3\\CMS\\FrontendLogin\\Configuration\\RecoveryConfiguration'));
        $c = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
        $c->injectConfigurationManager($a);
        $c->injectExtensionService(($this->services['TYPO3\\CMS\\Extbase\\Service\\ExtensionService'] ?? $this->getExtensionServiceService()));
        $c->initializeObject();

        return $this->privates['TYPO3\\CMS\\FrontendLogin\\Service\\RecoveryService'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\FrontendLogin\Service\RecoveryService::class, ($this->services['TYPO3\\CMS\\Core\\Mail\\Mailer'] ?? $this->getMailerService()), ($this->services['Psr\\EventDispatcher\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()), ($this->services['TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'] ?? $this->getConfigurationManagerService()), $b, $c, ($this->privates['TYPO3\\CMS\\FrontendLogin\\Domain\\Repository\\FrontendUserRepository'] ?? $this->getFrontendUserRepository4Service()));
    }

To compare, here is the dependency injection sequence that throw error :

/**
     * Gets the private 'TYPO3\CMS\FrontendLogin\Service\RecoveryService' shared autowired service.
     *
     * @return \TYPO3\CMS\FrontendLogin\Service\RecoveryService
     */
    protected function getRecoveryServiceService()
    {
        $a = ($this->services['TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'] ?? $this->getConfigurationManagerService());
        $b = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\FrontendLogin\Configuration\RecoveryConfiguration::class, ($this->services['TYPO3\\CMS\\Core\\Context\\Context'] ?? $this->getContextService()), $a, ($this->privates['TYPO3\\CMS\\Core\\Crypto\\Random'] ?? ($this->privates['TYPO3\\CMS\\Core\\Crypto\\Random'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Core\Crypto\Random::class))), ($this->services['TYPO3\\CMS\\Extbase\\Security\\Cryptography\\HashService'] ?? $this->getHashServiceService()));
        $b->setLogger(($this->services['_early.TYPO3\\CMS\\Core\\Log\\LogManager'] ?? $this->get('_early.TYPO3\\CMS\\Core\\Log\\LogManager', 1))->getLogger('TYPO3\\CMS\\FrontendLogin\\Configuration\\RecoveryConfiguration'));
        $c = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
        $c->injectConfigurationManager(($this->services['FluidTYPO3\\Flux\\Integration\\Overrides\\ChimeraConfigurationManager'] ?? ($this->services['FluidTYPO3\\Flux\\Integration\\Overrides\\ChimeraConfigurationManager'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\FluidTYPO3\Flux\Integration\Overrides\ChimeraConfigurationManager::class, $this))));
        $c->injectExtensionService(($this->services['TYPO3\\CMS\\Extbase\\Service\\ExtensionService'] ?? $this->getExtensionServiceService()));
        $c->initializeObject();

        return $this->privates['TYPO3\\CMS\\FrontendLogin\\Service\\RecoveryService'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\FrontendLogin\Service\RecoveryService::class, ($this->services['TYPO3\\CMS\\Core\\Mail\\Mailer'] ?? $this->getMailerService()), ($this->services['Psr\\EventDispatcher\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()), $a, $b, $c, ($this->privates['TYPO3\\CMS\\FrontendLogin\\Domain\\Repository\\FrontendUserRepository'] ?? $this->getFrontendUserRepository4Service()));
    }

from flux.

Konafets avatar Konafets commented on August 26, 2024

Can confirm this error. I also encounter it when try to clean up the flexform records via CLI

vendor/bin/typo3 cleanup:flexforms

Updates all database records which have a FlexForm field and the XML data does not match the chosen datastructure.
==================================================================================================================

 ! [NOTE] Found 1313 records with wrong FlexForms information.

Cleanup process starting now.
-----------------------------

Updated FlexForm in record "tt_content:1354".

Uncaught TYPO3 Exception TYPO3\CMS\Core\Http\ApplicationType::fromRequest(): Argument #1 ($request) must be of type Psr\Http\Message\ServerRequestInterface, null given, called in /Users/user/Sites/example.com/public/typo3conf/ext/flux/Classes/Service/RecordService.php on line 150
thrown in file /Users/user/Sites/example.com/public/typo3/sysext/core/Classes/Http/ApplicationType.php
in line 62

I deinstalled ext:flux and was able to repair the records without any further issue.

from flux.

sdelcroix avatar sdelcroix commented on August 26, 2024

@NamelessCoder I've just done a quick and unique test with the latest development and it seems to be working now.

No error and reset email has been sent.

Thank you very much ! 👍

from flux.

steffen-hph avatar steffen-hph commented on August 26, 2024

@NamelessCoder @sdelcroix Works for me too 👍

Thanks!

from flux.

NamelessCoder avatar NamelessCoder commented on August 26, 2024

Closing as solved.

from flux.

sdelcroix avatar sdelcroix commented on August 26, 2024

Fun fact : https://review.typo3.org/c/Packages/TYPO3.CMS/+/80941

from flux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.