Project

General

Profile

Actions

Bug #94015

closed

GeneralUtility::xml2array() can't be used in Guzzle middleware

Added by David Bruchmann over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-04-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
hard
Is Regression:
Sprint Focus:

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.

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #94701: Dashboard breaks if Guzzle Middleware is usedClosed2021-08-03

Actions
Actions #1

Updated by David Bruchmann over 3 years ago

Furthermore xml2arrayProcess can't be used as it's protected :(

Actions #2

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
Actions #3

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?

Actions #4

Updated by Benni Mack over 3 years ago

  • Related to Bug #94701: Dashboard breaks if Guzzle Middleware is used added
Actions #5

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.

Actions #6

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?

Actions #7

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.

Actions

Also available in: Atom PDF