Project

General

Profile

Actions

Feature #85312

closed

self defined BE_USER not possible in DataMapProcessor

Added by Franz Holzinger almost 6 years ago. Updated almost 6 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
Start date:
2018-06-19
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.0
Tags:
Complexity:
Sprint Focus:

Description

In TYPO3 6.2 and 7.6 I have used a self defined BE_USER object to use it with the DataHandler.

/** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
$tce = GeneralUtility::makeInstance('TYPO3\CMS\Core\DataHandling\DataHandler'); // create TCE instance
$tce->start($data, array(), $backendUser);
$tce->process_datamap();

This did work fine.
This feature is broken in typo3_src-8.7.15.

It raises an exception:

Argument 2 passed to TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::instance() must be an  instance of TYPO3\CMS\Core\Authentication\BackendUserAuthentication, instance of JambageCom\TtProducts\Backend\BackendUserSimulation given, called in /srv/www/myuser/pabstneuhtdocs/typo3_src-8.7.15/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 986
TypeError thrown in file
/srv/www/myuser/myuserneuhtdocs/typo3_src-8.7.15/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php in line 86
typo3_src-8.7.15/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php causes a compatibility break.
function instance requires a BackendUserAuthentication class and not a AbstractUserAuthentication as it should be. I see no reason why this is done.
This breaks the feature in file /home/franz/Downloads/TYPO3/typo3_src-8.7.15/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 986:
$this->datamap = DataMapProcessor::instance($this->datamap, $this->BE_USER)->process();* @param BackendUserAuthentication|null $altUserObject An alternative userobject you can set instead of the default, which is $GLOBALS['BE_USER']
*/
public function start($data, $cmd, $altUserObject = null)

There is no such requirement in the start method. $this->BE_USER can be of any class and should only derive from AbstractUserAuthentication .
I think this is a unwanted incompatibility which breaks the feature to have an alternative BE_USER object..


Files

patch-85312.diff (1.9 KB) patch-85312.diff Franz Holzinger, 2018-06-20 11:23
Actions

Also available in: Atom PDF