[BUGFIX] Prevent ReflectionException when scheduler/reports is unavailable 42/61342/4
authorBenjamin Franzke <bfr@qbus.de>
Tue, 23 Jul 2019 12:18:18 +0000 (14:18 +0200)
committerSusanne Moog <look@susi.dev>
Sun, 4 Aug 2019 08:24:33 +0000 (10:24 +0200)
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 <noreply@typo3.com>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Susanne Moog <look@susi.dev>
typo3/sysext/extensionmanager/Configuration/Services.yaml
typo3/sysext/linkvalidator/Configuration/Services.yaml
typo3/sysext/recycler/Configuration/Services.yaml
typo3/sysext/reports/Configuration/Services.yaml

index a913c94..d944395 100644 (file)
@@ -6,3 +6,6 @@ services:
 
   TYPO3\CMS\Extensionmanager\:
     resource: '../Classes/*'
+    # Tasks require EXT:scheduler, reports require
+    # EXT:reports to be installed, ignore for now.
+    exclude: '../Classes/{Task,Report}'
index f5615ce..2ef1237 100644 (file)
@@ -6,3 +6,5 @@ services:
 
   TYPO3\CMS\Linkvalidator\:
     resource: '../Classes/*'
+    # Tasks require EXT:scheduler to be installed, ignore for now.
+    exclude: '../Classes/Task'
index b392e22..3528693 100644 (file)
@@ -6,3 +6,5 @@ services:
 
   TYPO3\CMS\Recycler\:
     resource: '../Classes/*'
+    # Tasks require EXT:scheduler to be installed, ignore for now.
+    exclude: '../Classes/Task'
index c98772c..d2f3ca1 100644 (file)
@@ -6,3 +6,5 @@ services:
 
   TYPO3\CMS\Reports\:
     resource: '../Classes/*'
+    # Tasks require EXT:scheduler to be installed, ignore for now.
+    exclude: '../Classes/Task'