Bug #88825

Epic #83968: PSR-11 Initiative

Exception during Dependency Injection Container compilation when EXT:scheduler is not available

Added by Benjamin Franzke 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Must have
Category:
System/Bootstrap/Configuration
Start date:
2019-07-23
Due date:
% Done:

100%

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

Description

This is with TYPO3 v10 installed using composer, without EXT:scheduler being available.

Installtion step 5 fails due to container being built. Frontend and Backend can not be opened.

During class fetch: Uncaught ReflectionException: Class TYPO3\CMS\Scheduler\Task\AbstractTask not found in […]/public/typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php:28
Stack trace:
#0 […]/vendor/composer/ClassLoader.php(444): include('/home/ben/src/t...')
#1 […]/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/ben/src/t...')
#2 […]/vendor/typo3/class-alias-loader/src/ClassAliasLoader.php(130): Composer\Autoload\ClassLoader->loadClass('TYPO3\\CMS\\Repor...')
#3 […]/vendor/typo3/class-alias-loader/src/ClassAliasLoader.php(120): TYPO3\ClassAliasLoader\ClassAliasLoader->loadClass('TYPO3\\CMS\\Repor...')
#4 [internal function]: TYPO3\ClassAliasLoader\ClassAliasLoader->loadClassWithAlias('TYPO3\\CMS\\Repor...')
#5 [internal function]: spl_autoload_call('TYPO3\\CMS\\Repor...')
#6 […] in […]/public/typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php on line 28

Related issues

Related to TYPO3 Core - Bug #88912: Broken autowiring for non required dependencies Rejected 2019-08-03

Associated revisions

Revision f8f09efb (diff)
Added by Benjamin Franzke 3 months ago

[BUGFIX] Prevent ReflectionException when scheduler/reports is unavailable

When symfony/dependency-injection crawls the available classes
a ReflectionException [1] occurs when the base class or interface of an
analyzed class is not available.

This currently happens for scheduler tasks and status reports in composer
mode. The dependency to external base classes/interfaces is missing in the
respective composer.json files and therefore EXT:scheduler and EXT:reports
are not guaranteed to be availble.

Exclude the affected status report and scheduler task classes from
autowiring and autoconfiguration in order to fix this issue.

Note: Dependency injection can still be added for these classes,
but as long as the implicit dependencies to EXT:scheduler and EXT:reports
are not fixed, these classes will need to be wired manually. Example:

TYPO3\CMS\Reports\Task\SystemStatusUpdateTask:
autoconfigure: false
autowire: false
public: true
arguments:
- '@cache.core'

[1] Uncaught ReflectionException:
Class TYPO3\CMS\Scheduler\Task\AbstractTask not found in
[…]/typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php:28

Resolves: #88825
Resolves: #88912
Releases: master
Change-Id: I74113aa87336bbde02b8754639eafc4158dc3717
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61342
Tested-by: TYPO3com <>
Tested-by: Frank Naegler <>
Tested-by: Susanne Moog <>
Reviewed-by: Frank Naegler <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Gerrit Code Review 4 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/+/61342

#2 Updated by Gerrit Code Review 4 months 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/+/61342

#3 Updated by Benjamin Franzke 3 months ago

  • Related to Bug #88912: Broken autowiring for non required dependencies added

#4 Updated by Gerrit Code Review 3 months 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/+/61342

#5 Updated by Benjamin Franzke 3 months ago

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

Also available in: Atom PDF