[TYPO3-dev] TCE Datahandler admin-flag not working correctly

Jan Bartels j.bartels at arcor.de
Tue Jan 5 22:09:38 CET 2016


I've just debugged the SysAction for adding/editing BE-Users. See 
https://forge.typo3.org/issues/72391 for details.

I think that the TCE-DataHandler is not working correctly in this 
use-case. The method ActionTask::saveNewBackendUser() calls the 
TCE-DataHandler as follows:

// Save/update user by using TCEmain
if (is_array($data)) {
	$tce = 
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
	$tce->stripslashes_values = 0;
	$tce->start($data, array(), $GLOBALS['BE_USER']);
	$tce->admin = 1;
	$tce->process_datamap();

The admin-flag should enable TCEmain to set all DB-fields without any 
restrictions, but DataHandler::fillInFieldArray() ignores the admin-flag 
when checking for disabled fields:

foreach ($incomingFieldArray as $field => $fieldValue) {
	if (!in_array(($table . '-' . $field), $this->exclude_array) && 
!$this->data_disableFields[$table][$id][$field] ) {

I'd suggest to add an extra condition "|| $this->admin" to this 
if-statement to ignore any disabled fields that are restricting the 
original calling BE-user. It would be great if a core-dev could have a 
look at this issue. There are some more detailled information available 
on https://forge.typo3.org/issues/72391.

Jan



More information about the TYPO3-dev mailing list