[BUGFIX] Fix PHP Warning on executing Database Analyzer without changes 70/30670/3
authorStephan Großberndt <stephan@grossberndt.de>
Wed, 11 Jun 2014 20:11:00 +0000 (22:11 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 11 Jun 2014 20:45:21 +0000 (22:45 +0200)
When running the Database Analyzers "Execute" without checking at least
one checkbox you get a PHP Warning "array_merge(): Argument #2 is not
an array" because instead of returning an array with a message only the
message string was returned.

Fix this by returning the correct variable, which is of type array.

Resolves: #59504
Releases: 6.2
Change-Id: Ifd73d617a4a97f07151fe0e6c6971bcd79c9709c
Reviewed-on: https://review.typo3.org/30670
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php

index 5ca922f..60743e6 100644 (file)
@@ -264,13 +264,13 @@ class ImportantActions extends Action\AbstractAction {
        protected function databaseAnalyzerExecute() {
                $messages = array();
 
-               // Early return in case no updade was selected
+               // Early return in case no update was selected
                if (empty($this->postValues['values'])) {
                        /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
                        $message->setTitle('No database changes selected');
                        $messages[] = $message;
-                       return $message;
+                       return $messages;
                }
 
                /** @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService $schemaMigrationService */