[BUGFIX] Re-integrate missing slot "postProcessMirrorUrl" 20/39520/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 13 May 2015 08:12:17 +0000 (10:12 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 13 May 2015 08:45:44 +0000 (10:45 +0200)
The slot "postProcessMirrorUrl" got lost while refactoring the
"Language" backend module. It is re-integrated with this patch.

Resolves: #66928
Related: #50467
Releases: master
Change-Id: I7769d55434ba4724781b8e3ea01a25b1ba907089
Reviewed-on: http://review.typo3.org/39520
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/lang/Classes/Service/TranslationService.php

index 51c6913..122bf9d 100644 (file)
@@ -38,6 +38,12 @@ class TranslationService implements \TYPO3\CMS\Core\SingletonInterface {
        protected $terService;
 
        /**
+        * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
+        * @inject
+        */
+       protected $signalSlotDispatcher;
+
+       /**
         * @var string
         */
        protected $mirrorUrl = '';
@@ -89,11 +95,31 @@ class TranslationService implements \TYPO3\CMS\Core\SingletonInterface {
                        return static::TRANSLATION_INVALID;
                }
                $state = static::TRANSLATION_FAILED;
-               $updateResult = $this->terService->updateTranslation($extensionKey, $locale, $this->mirrorUrl);
+
+               $updateResult = $this->terService->updateTranslation($extensionKey, $locale, $this->getMirrorUrl($extensionKey));
                if ($updateResult === TRUE) {
                        $state = static::TRANSLATION_UPDATED;
                }
                return $state;
        }
 
+       /**
+        * Returns the mirror URL for a given extension.
+        *
+        * @param string $extensionKey
+        * @return string
+        */
+       protected function getMirrorUrl($extensionKey) {
+               $this->signalSlotDispatcher->dispatch(
+                       __CLASS__,
+                       'postProcessMirrorUrl',
+                       array(
+                               'extensionKey' => $extensionKey,
+                               'mirrorUrl' => &$this->mirrorUrl,
+                       )
+               );
+
+               return $this->mirrorUrl;
+       }
+
 }