Actions
Bug #93889
closedCannot modify language pack remote base URL
Status:
Closed
Priority:
Should have
Assignee:
Category:
Localization
Target version:
Start date:
2021-04-09
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Description
Since the move to PSR-14 one cannot modify the language pack remote base URL.
This is following event:
TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent
The reason is that the listener provider TYPO3\CMS\Core\EventDispatcher\ListenerProvider
has an empty list of initialized listeners (member listeners
), most probably in relation with the context (Install Tool).
Configuration¶
In EXT:yourExt/Configuration/Settings.yaml
:
VENDOR\YourExt\EventListener\InstallServiceEventListener: tags: - name: event.listener identifier: 'VENDOR/yourExt' method: 'modifyLanguagePackRemoteBaseUrl' event: TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent
Sample class VENDOR\YourExt\EventListener\InstallServiceEventListener
:
namespace VENDOR\YourExt\EventListener; use TYPO3\CMS\Core\Http\Uri; use TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent; class InstallServiceEventListener { /** * @param ModifyLanguagePackRemoteBaseUrlEvent $event */ public function modifyLanguagePackRemoteBaseUrl(ModifyLanguagePackRemoteBaseUrlEvent $event): void { if ($event->getPackageKey() === 'yourExt') { $event->setBaseUrl(new Uri('https://www.example.com/packages/')); } } }
Expected¶
The method is invoked.
What happens¶
The method is not invoked as no listeners seems to be registered in that context.
Actions