[BUGFIX] Add user authentication to activate extension command 36/58536/2
authorSusanne Moog <susanne.moog@typo3.org>
Mon, 1 Oct 2018 16:24:39 +0000 (18:24 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 1 Oct 2018 16:55:22 +0000 (18:55 +0200)
As extensions might contain data to import the activate extension
command needs to initialize the user authentication so the data
handler may import data.

The backend user authentication initialization has been added to
the activate extension command.

Resolves: #86161
Releases: master
Change-Id: Id25c45bdfc8ac1cb930c9ed6adb49c39c17d7952
Reviewed-on: https://review.typo3.org/58536
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/extensionmanager/Classes/Command/ActivateExtensionCommand.php

index 94afb6b..060e8a8 100644 (file)
@@ -20,6 +20,7 @@ use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Style\SymfonyStyle;
+use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
@@ -56,6 +57,9 @@ class ActivateExtensionCommand extends Command
         $io = new SymfonyStyle($input, $output);
         $extensionKey = $input->getArgument('extensionkey');
 
+        // Ensure the _cli_ user is authenticated because the extension might import data
+        Bootstrap::initializeBackendAuthentication();
+
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
         // Emits packages may have changed signal
         $signalSlotDispatcher = $objectManager->get(Dispatcher::class);