Bug #88843

Registering a hook for tcaIsBeingBuilt triggers LogicException

Added by Robert Vock about 2 months ago. Updated 24 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-07-25
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

I've just tried the newly released TYPO3 v10 and stumbled upon an exception.

When you register a Slot for the Signal tcaIsBeingBuilt in your ext_localconf, you will get a LogicException in TYPO3 v10.0.0:


$signalSlotDispatcher->connect(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::class, 'tcaIsBeingBuilt', \Example\ExampleExtension\TCA::class, 'addTCA');

The Exception is:


(1/1) #1549446998 LogicException
TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead.

This apparently happens when the signal is dispatched via Extbase. An ObjectManager is created which would get a CacheManager:
Dispatcher.php#L126

Associated revisions

Revision 6d7fb6e9 (diff)
Added by Benjamin Franzke 24 days ago

[BUGFIX] Ensure ReflectionService can be used during TCA load

In order to support the 'tcaIsBeingBuilt' for legacy signal
listeners that are not available in the symfony container,
we need to enable the Extbase Object Container to use the
(lazy loaded) ReflectionService, which requires the CacheManager
to be available.
Therefore we now mark "boot.state" done once ext_localconf.php
has been loaded. boot.state = true will allow the CacheManager
to be created in TYPO3\CMS\Core\ServiceProvider instead of
throwing a LogicException.

Releases: master
Resolves: #88843
Change-Id: I93f182d1e84f65ae005a8e51a0faff5e47dc36f0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61373
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Anja Leichsenring <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review about 2 months 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/+/61373

#2 Updated by Gerrit Code Review 28 days 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/+/61373

#3 Updated by Benjamin Franzke 24 days ago

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

Also available in: Atom PDF