[BUGFIX] Add postProcessMirrorUrl to language updater again 65/58265/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 13 Sep 2018 11:25:41 +0000 (13:25 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 13 Sep 2018 15:16:46 +0000 (17:16 +0200)
With moving the language pack updater to the install tool, a
signal got lost that allowed overriding the base download url
of language packs per extension.
The patch introduces this signal again.

Resolves: #84691
Related: #84131
Releases: master
Change-Id: I659a8829b292d9c268ee3ee9df851d971ba5ddd7
Reviewed-on: https://review.typo3.org/58265
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Delius <me@jandelius.eu>
Tested-by: Jan Delius <me@jandelius.eu>
Reviewed-by: Rico Drexler <rico.drexler@gmx.de>
Tested-by: Rico Drexler <rico.drexler@gmx.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Classes/Controller/MaintenanceController.php
typo3/sysext/install/Classes/Service/LanguagePackService.php

index a301198..fba04b7 100644 (file)
@@ -697,6 +697,7 @@ class MaintenanceController extends AbstractController
      */
     public function languagePacksUpdatePackAction(ServerRequestInterface $request): ResponseInterface
     {
+        $this->loadExtLocalconfDatabaseAndExtTables();
         $iso = $request->getParsedBody()['install']['iso'];
         $key = $request->getParsedBody()['install']['extension'];
         $languagePackService = GeneralUtility::makeInstance(LanguagePackService::class);
index 2d10dde..9edc37c 100644 (file)
@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
+use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
 
 /**
  * Service class handling language pack details
@@ -221,6 +222,16 @@ class LanguagePackService
         if (empty($languagePackBaseUrl)) {
             throw new \RuntimeException('Language pack baseUrl not found', 1520169691);
         }
+        // Allow to modify the base url on the fly by calling a signal
+        $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
+        $signalSlotDispatcher->dispatch(
+            'TYPO3\\CMS\\Lang\\Service\\TranslationService',
+            'postProcessMirrorUrl',
+            [
+                'extensionKey' => $key,
+                'mirrorUrl' => &$languagePackBaseUrl,
+            ]
+        );
 
         $path = ExtensionManagementUtility::extPath($key);
         $majorVersion = explode('.', TYPO3_branch)[0];