Skip to content

Commit

Permalink
[TASK] Create DataHandler using GU::makeInstance() (#602) (#605)
Browse files Browse the repository at this point in the history
To prepare DH for DI, consumers must use core
instance factory method instead of new().
  • Loading branch information
lolli42 authored Aug 10, 2024
1 parent f508b8e commit d4a6bd9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class DataHandlerWriter
{
Expand All @@ -44,7 +45,7 @@ class DataHandlerWriter
public static function withBackendUser(
BackendUserAuthentication $backendUser
): self {
$dataHandler = new DataHandler();
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
if (isset($backendUser->uc['copyLevels'])) {
$dataHandler->copyTree = $backendUser->uc['copyLevels'];
}
Expand Down

0 comments on commit d4a6bd9

Please sign in to comment.