Breaking: #97320 - Register Report and Status via Service Configuration
See forge#97320
Description
The reports and status in EXT:reports are now registered via service
configuration, see the feature changelog.
Therefore the registration via
$GLOBALS
has been removed.
Additionally, to be able to use autoconfiguration, the following interfaces have been extended:
\TYPO3\:CMS\ Reports\ Report Interface get,Identifier get,Icon Identifier get,Title getDescription \TYPO3\:CMS\ Reports\ Status Provider Interface getLabel
Impact
Registration of custom reports via
$GLOBALS
are not evaluated anymore.
Registration of custom status via
$GLOBALS
are not evaluated anymore.
Report and
Status: are extended by the mentioned methods. If the required methods are not implemented it will lead to fatal errors.
Affected Installations
All TYPO3 installations using the old registration.
All TYPO3 installations with custom reports, not implementing
public function get,
public function get,
public function get,
public function get
All TYPO3 installations with custom status, not implementing
public function get
Migration
By implementing the required methods of the interfaces, the custom reports are fully backwards compatible.
If TYPO3 v12+ is the only supported version, the configuration
$GLOBALS from the ext_ file can be removed as well.
Report
If
autoconfigure is not enabled in your Configuration/,
add the tag
reports. manually to your reports service.
Vendor\Extension\Report\MyReport:
tags:
- name: reports.report
The old registration can be removed, if support for TYPO3 v11 or lower is not necessary.
// Before in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['extension']['general'] = [
'title' => 'LLL:EXT:extension/Resources/Private/Language/locallang.xlf:title',
'description' => 'LLL:EXT:extension/Resources/Private/Language/locallang.xlf:description',
'icon' => 'EXT:extension/Resources/Public/Icons/Extension.svg',
'report' => \Vendor\Extension\Report::class
];
Additionally, make sure to implement all methods of
\TYPO3\.
// Changes for the report
class Report implements ReportInterface
{
public function getReport(): string
{
return 'Full report';
}
public function getIdentifier(): string
{
return 'general';
}
public function getTitle(): string
{
return 'LLL:EXT:extension/Resources/Private/Language/locallang.xlf:title';
}
public function getDescription(): string
{
return 'LLL:EXT:extension/Resources/Private/Language/locallang.xlf:description';
}
public function getIconIdentifier(): string
{
return 'module-reports';
}
}
Refer to the Icon API on how to register the icon.
Status
If
autoconfigure is not enabled in your Configuration/,
add the tag
reports. manually to your status service.
Vendor\Extension\Status\MyStatus:
tags:
- name: reports.report
The old registration can be removed, if support for TYPO3 v11 or lower is not necessary.
// Before in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['label'] = [
\Vendor\Extension\Status::class,
];
Additionally, make sure to implement all methods of
\TYPO3\.
// Changes for the Status
class Status implements StatusProviderInterface
{
public function getStatus(): array
{
return [];
}
public function getLabel(): string
{
return 'label';
}
}