[BUGFIX] Populate loaded commands after ext_tables is loaded 70/53270/2
authorBenni Mack <benni@typo3.org>
Tue, 20 Jun 2017 09:00:58 +0000 (11:00 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 20 Jun 2017 11:18:37 +0000 (13:18 +0200)
Especially in TYPO3 v8, where TCA is not loaded at all times,
running a CLI command with an empty cache will result in
errors, but for the sake of clean structure, the commands
will be populated when executing the actual command.

Resolves: #80897
Releases: master, 8.7
Change-Id: I7ad33ca86724d94f451c44f68538d5d38e343636
Reviewed-on: https://review.typo3.org/53270
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Thomas Maroschik <tmaroschik@dfau.de>
Tested-by: Thomas Maroschik <tmaroschik@dfau.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Console/CommandRequestHandler.php

index e217e3c..f583be9 100644 (file)
@@ -68,6 +68,8 @@ class CommandRequestHandler implements RequestHandlerInterface
             // Make sure output is not buffered, so command-line output and interaction can take place
             ->endOutputBufferingAndCleanPreviousOutput();
 
+        $this->populateAvailableCommands();
+
         $exitCode = $this->application->run($input, $output);
         exit($exitCode);
     }
@@ -80,7 +82,6 @@ class CommandRequestHandler implements RequestHandlerInterface
      */
     public function canHandleRequest(InputInterface $input)
     {
-        $this->populateAvailableCommands();
         return true;
     }