#50758Attempt to modify record '69' (sys_file_reference:69) without permission. Or non-existing page.
Description
In my extension I would like to delete any sys_file_references attached to my tt_content element before adding my own.
The jobs gets done (The sys_file_reference is set to deleted), but I get the “Attempt to modify record ‘69’ (sys_file_reference:69) without permission. Or non-existing page.”
I have the following in my processDatamap_afterDatabaseOperations:
$select = 'sys_file_reference.*';
$table = 'sys_file_reference';
$where = 'sys_file_reference.uid_foreign = '.$tt_content['uid'].' AND sys_file_reference.tablenames = "tt_content" AND sys_file_reference.fieldname = "tx_tc_video_image"';
$groupBy = '';
$orderBy = '';
$limit = '';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $table, $where, $groupBy, $orderBy, $limit);
if($GLOBALS['TYPO3_DB']->sql_num_rows($res)){
$cmd = array();
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
$cmd['sys_file_reference'][$row['uid']]['delete'] = true;
}
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_TCEmain');
$tce->stripslashes_values = 0;
$GLOBALS['BE_USER']->user['admin'] = true;
$tce->start(array(), $cmd);
$tce->process_cmdmap();
}
Any clues?
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.