[BUGFIX] Populate loaded commands after ext_tables is loaded 79/53279/3
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:38:24 +0000 (13:38 +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/53279
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Console/CommandRequestHandler.php

index f841fee..0756ac8 100644 (file)
@@ -69,6 +69,8 @@ class CommandRequestHandler implements RequestHandlerInterface
             // Make sure output is not buffered, so command-line output and interaction can take place
             ->endOutputBufferingAndCleanPreviousOutput();
 
+        $this->populateAvailableCommands();
+
         // Check if the command to run needs a backend user to be loaded
         $command = $this->getCommandToRun($input);
 
@@ -98,7 +100,6 @@ class CommandRequestHandler implements RequestHandlerInterface
      */
     public function canHandleRequest(InputInterface $input)
     {
-        $this->populateAvailableCommands();
         return true;
     }