aimeos/aimeos-typo3

Wrong locale controller instance in TYPO3 10

guelzow opened this issue · 2 comments

Hi everyone.

TYPO3 10 confuses the old plug-in registration with the new TYPO3-10 plugin registration, if the used controller name actually exists in the system.

Here https://github.com/aimeos/aimeos-typo3/blob/master/ext_localconf.php#L30
TYPO3-10 thinks, the new way is used, when the class \Locale exists,

When then the plugin is used, it instantiates the \Locale class, and then complains about it not implementing the controller interface.
The other plugin registrations may also be affected, depending on the existing classes in the root namespace.

Our solution so far:

if ( version_compare( TYPO3_version, '10.0.0', '<' ) ) {
	$localeController = 'Locale';
} else {
	$localeController = \Aimeos\Aimeos\Controller\LocaleController::class;
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
	'Aimeos.aimeos',
	'locale-select',
	array( $localeController => 'select' ),
	array( $localeController => 'select' )
);

Tobi

Hm, it's not possible to use the full class name in TYPO3 9 too?