[BUGFIX] FollowUp: Fix signal returns for associated signal arguments 73/31073/2
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 23 Jun 2014 07:47:40 +0000 (09:47 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 23 Jun 2014 13:46:22 +0000 (15:46 +0200)
Fix broken functional tests. Add a fallback for earlier used associated
returns. Furthermore this patch reintroduces referenced signal arguments
to support old registered slots.

Resolves: #59794
Releases: 6.3, 6.2
Change-Id: Icfe997998476b9bdf77aba280eb87ca42786def8
Reviewed-on: https://review.typo3.org/31073
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/documentation/Classes/Controller/DocumentController.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ProcessAvailableActionsViewHelper.php
typo3/sysext/install/Classes/Service/SqlExpectedSchemaService.php
typo3/sysext/lang/Classes/Service/UpdateTranslationService.php

index 6f263a3..51f5165 100644 (file)
@@ -2084,8 +2084,8 @@ class ResourceStorage implements ResourceStorageInterface {
         * @return string Modified target file name
         */
        protected function emitPreFileAddSignal($targetFileName, Folder $targetFolder, $sourceFilePath) {
-               $signalArguments = $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', self::SIGNAL_PreFileAdd, array($targetFileName, $targetFolder, $sourceFilePath, $this, $this->driver));
-               return $signalArguments[0];
+               $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', self::SIGNAL_PreFileAdd, array(&$targetFileName, $targetFolder, $sourceFilePath, $this, $this->driver));
+               return $targetFileName;
        }
 
        /**
index b70652c..380fd42 100644 (file)
@@ -99,15 +99,15 @@ class DocumentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
         * @return \TYPO3\CMS\Documentation\Domain\Model\Document[]
         */
        protected function emitAfterInitializeDocumentsSignal($language, array $documents) {
-               $signalArguments = $this->signalSlotDispatcher->dispatch(
+               $this->signalSlotDispatcher->dispatch(
                        __CLASS__,
                        'afterInitializeDocuments',
                        array(
                                $language,
-                               $documents,
+                               &$documents,
                        )
                );
-               return $signalArguments[1];
+               return $documents;
        }
 
        /**
index 8bec745..42653d1 100644 (file)
@@ -255,6 +255,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         */
        protected function emitTablesDefinitionIsBeingBuiltSignal($extensionKey) {
                $signalReturn = $this->signalSlotDispatcher->dispatch(__CLASS__, 'tablesDefinitionIsBeingBuilt', array(array(), $extensionKey));
+               // This is important to support old associated returns
+               $signalReturn = array_values($signalReturn);
                $sqlString = $signalReturn[0];
                if (!is_array($sqlString)) {
                        throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
index 170ce2f..4360d6c 100644 (file)
@@ -53,15 +53,15 @@ class ProcessAvailableActionsViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Lin
         * @return array Modified action array
         */
        protected function emitProcessActionsSignal($extension, array $actions) {
-               $signalArguments = $this->signalSlotDispatcher->dispatch(
+               $this->signalSlotDispatcher->dispatch(
                        __CLASS__,
                        static::SIGNAL_ProcessActions,
                        array(
                                $extension,
-                               $actions,
+                               &$actions,
                        )
                );
-               return $signalArguments[1];
+               return $actions;
        }
 
 }
index d4ba68b..47265ec 100644 (file)
@@ -87,6 +87,8 @@ class SqlExpectedSchemaService {
         */
        protected function emitTablesDefinitionIsBeingBuiltSignal(array $sqlString) {
                $signalReturn = $this->signalSlotDispatcher->dispatch(__CLASS__, 'tablesDefinitionIsBeingBuilt', array($sqlString));
+               // This is important to support old associated returns
+               $signalReturn = array_values($signalReturn);
                $sqlString = $signalReturn[0];
                if (!is_array($sqlString)) {
                        throw new Exception\UnexpectedSignalReturnValueTypeException(
index 671b96a..5eb0a46 100644 (file)
@@ -198,15 +198,15 @@ class UpdateTranslationService {
         * @return string Modified mirror url
         */
        protected function emitPostProcessMirrorUrlSignal($extensionKey, $mirrorUrl) {
-               $signalArguments = $this->signalSlotDispatcher->dispatch(
+               $this->signalSlotDispatcher->dispatch(
                        __CLASS__,
                        'postProcessMirrorUrl',
                        array(
                                $extensionKey,
-                               $mirrorUrl,
+                               &$mirrorUrl,
                        )
                );
-               return $signalArguments[1];
+               return $mirrorUrl;
        }
 
 }