Bug #94015
closedGeneralUtility::xml2array() can't be used in Guzzle middleware
0%
Description
Using a middleware like this:
# Add custom middleware to default Guzzle handler stack $GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] = (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\ACME\Middleware\Guzzle\CustomMiddleware::class))->handler();
it's not possible to use xml2array, instead an error-message is thrown:
[CRITICAL] request="c379d512eb551" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1549446998: TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead. | LogicException thrown in file typo3/sysext/core/Classes/ServiceProvider.php in line 97.
Updated by David Bruchmann over 3 years ago
Furthermore xml2arrayProcess can't be used as it's protected :(
Updated by Andreas Kienast over 3 years ago
- Subject changed from GeneralUtility::xml2array() can't be used in Middleware to GeneralUtility::xml2array() can't be used in Guzzle middleware
Updated by Benni Mack over 3 years ago
- Status changed from New to Needs Feedback
Hey David,
is this issue related to the other Guzzle middleware approach you had last week?
Updated by Benni Mack over 3 years ago
- Related to Bug #94701: Dashboard breaks if Guzzle Middleware is used added
Updated by David Bruchmann over 3 years ago
Hi Benni,
yes, correct.
As a real Guzzle middleware consists of at least 2 inherited closures it's running completely on another context and had to be tested.
The most inner closure is instantiated at another time and has therefore perhaps more classes available, but I'm not sure about it.
Updated by Benni Mack over 3 years ago
David Bruchmann wrote in #note-5:
Hi Benni,
yes, correct.
As a real Guzzle middleware consists of at least 2 inherited closures it's running completely on another context and had to be tested.
The most inner closure is instantiated at another time and has therefore perhaps more classes available, but I'm not sure about it.
Anything to do from my side here?
Updated by Christian Kuhn almost 3 years ago
- Status changed from Needs Feedback to Closed
Hey. I hope it's ok to close here for now - it's unclear if there is anything core can do in this context. Let's restart with a fresh issue in case something is left.