[BUGFIX] Consequently forward backend user context in DataHandler 85/57985/3
authorOliver Hader <oliver@typo3.org>
Wed, 22 Aug 2018 09:13:20 +0000 (11:13 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 22 Aug 2018 10:26:23 +0000 (12:26 +0200)
DataHandler can be invoked with an individual backend user context and
will fall back to $GLOBALS['BE_USER'] in case it's not defined. In order
to make use of that behavior completely this individual context has to
be forwarded to all nested DataHandler instances as well.

Resolves: #85920
Releases: master
Change-Id: Ibcbba7d04d0967955937f838b6514a478b88d038
Reviewed-on: https://review.typo3.org/57985
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Daniel Gorges <daniel.gorges@b13.de>
Tested-by: Daniel Gorges <daniel.gorges@b13.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index b4b1b72..4348cc9 100644 (file)
@@ -1136,7 +1136,7 @@ class DataHandler implements LoggerAwareInterface
                                     // Default is to create a version of the individual records... element versioning that is.
                                     'label' => 'Auto-created for WS #' . $this->BE_USER->workspace
                                 ];
-                                $tce->start([], $cmd);
+                                $tce->start([], $cmd, $this->BE_USER);
                                 $tce->process_cmdmap();
                                 $this->errorLog = array_merge($this->errorLog, $tce->errorLog);
                                 // If copying was successful, share the new uids (also of related children):
@@ -5029,7 +5029,7 @@ class DataHandler implements LoggerAwareInterface
             /** @var DataHandler $tce */
             $tce = GeneralUtility::makeInstance(__CLASS__);
             $tce->enableLogging = $this->enableLogging;
-            $tce->start([], $removeArray);
+            $tce->start([], $removeArray, $this->BE_USER);
             $tce->process_cmdmap();
             unset($tce);
         }
@@ -5465,7 +5465,7 @@ class DataHandler implements LoggerAwareInterface
                 $dataHandler = GeneralUtility::makeInstance(__CLASS__);
                 $dataHandler->enableLogging = $this->enableLogging;
                 $dataHandler->neverHideAtCopy = true;
-                $dataHandler->start([], $command);
+                $dataHandler->start([], $command, $this->BE_USER);
                 $dataHandler->process_cmdmap();
                 unset($dataHandler);