Commit 9459f9c4 authored by Wouter Wolters's avatar Wouter Wolters Committed by Morton Jonuschat
Browse files

[!!!][TASK] Remove deprecated code from DataHandler

Resolves: #72385
Releases: master
Change-Id: Iee37e2ae9a8c74116795ad60983a9849738bb15d
Reviewed-on: https://review.typo3.org/45365


Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
parent 3290bcbc
......@@ -523,7 +523,6 @@ class EditDocumentController extends AbstractModule
// Only options related to $this->data submission are included here.
/** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
if (!empty($control)) {
$tce->setControl($control);
......
......@@ -386,7 +386,6 @@ class FormInlineAjaxController
/** @var $tce DataHandler */
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
$tce->start(array(), $cmd);
$tce->process_cmdmap();
......
......@@ -480,7 +480,6 @@ class PageLayoutController
{
if ($this->clear_cache) {
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
$tce->start(array(), array());
$tce->clear_cacheCmd($this->id);
}
......
......@@ -143,7 +143,6 @@ class SimpleDataHandlerController
$this->uPT = GeneralUtility::_GP('uPT');
// Creating TCEmain object
$this->tce = GeneralUtility::makeInstance(DataHandler::class);
$this->tce->stripslashes_values = 0;
// Configuring based on user prefs.
if ($beUser->uc['recursiveDelete']) {
// TRUE if the delete Recursive flag is set.
......
......@@ -199,7 +199,6 @@ class AddController extends AbstractWizardController
if (is_array($currentParentRow)) {
/** @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->stripslashes_values = false;
$data = array();
$recordId = $this->table . '_' . $this->id;
// Setting the new field data:
......
......@@ -294,7 +294,6 @@ class TableController extends AbstractWizardController
// Get DataHandler object:
/** @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->stripslashes_values = false;
// Put content into the data array:
$data = array();
if ($this->P['flexFormPath']) {
......
......@@ -239,7 +239,6 @@ class RecordHistory
// Writes the data:
if ($cmdmapArray) {
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = 0;
$tce->debug = 0;
$tce->dontProcessTransformations = 1;
$tce->start(array(), $cmdmapArray);
......@@ -274,7 +273,6 @@ class RecordHistory
$data = $this->removeFilefields($rollbackData[0], $data);
// Writes the data:
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = 0;
$tce->debug = 0;
$tce->dontProcessTransformations = 1;
$tce->start($data, array());
......
......@@ -205,7 +205,6 @@ class Commands
{
/** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
$tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = 0;
$tce->start($data, $cmd);
$tce->copyTree = MathUtility::forceIntegerInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
if (!empty($cmd)) {
......
......@@ -87,7 +87,6 @@ class PermissionAjaxController
// Init TCE for execution of update
/** @var $tce DataHandler */
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
// Determine the scripts to execute
switch ($this->conf['action']) {
case 'show_change_owner_selector':
......
......@@ -371,7 +371,6 @@ abstract class AbstractRecordCollection implements RecordCollectionInterface, Pe
}
/** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = 0;
$tce->start($data, array());
$tce->process_datamap();
}
......
......@@ -84,15 +84,6 @@ class DataHandler
*/
public $checkSimilar = true;
/**
* If TRUE, incoming values in the data-array have their slashes stripped. ALWAYS SET THIS TO ZERO and supply an
* unescaped data array instead. This switch may totally disappear in future versions of this class!
*
* @var bool
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public $stripslashes_values = true;
/**
* This will read the record after having updated or inserted it. If anything is not properly submitted an error
* is written to the log. This feature consumes extra time by selecting records
......@@ -137,14 +128,6 @@ class DataHandler
*/
public $dontProcessTransformations = false;
/**
* If set, .vDEFbase values are unset in flexforms.
*
* @var bool
* @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
*/
public $clear_flexFormData_vDEFbase = false;
/**
* TRUE: (traditional) Updates when record is saved. For flexforms, updates if change is made to the localized value.
* FALSE: Will not update anything.
......@@ -391,12 +374,6 @@ class DataHandler
*/
protected $excludedTablesAndFields = array();
/**
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
* @var int
*/
public $include_filefunctions;
/**
* Data submitted from the form view, used to control behaviours,
* e.g. this is used to activate/deactivate fields and thus store NULL values
......@@ -1174,7 +1151,6 @@ class DataHandler
/** @var $tce DataHandler */
$tce = GeneralUtility::makeInstance(__CLASS__);
$tce->stripslashes_values = false;
// Setting up command for creating a new version of the record:
$cmd = array();
$cmd[$table][$id]['version'] = array(
......@@ -1471,18 +1447,6 @@ class DataHandler
continue;
}
// Stripping slashes - will probably be removed the day $this->stripslashes_values is removed as an option...
// @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
if ($this->stripslashes_values) {
GeneralUtility::deprecationLog(
'The option stripslash_values is typically set to FALSE as data should be properly prepared before sending to DataHandler. Do not rely on DataHandler removing extra slashes. The option will be removed in TYPO3 CMS 8.'
);
if (is_array($fieldValue)) {
GeneralUtility::stripSlashesOnArray($fieldValue);
} else {
$fieldValue = stripslashes($fieldValue);
}
}
switch ($field) {
case 'uid':
case 'pid':
......@@ -1751,23 +1715,6 @@ class DataHandler
return $res;
}
/**
* Evaluate "text" type values.
*
* @param array $res The result array. The processed value (if any!) is set in the "value" key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @param string $field Field name
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_text($res, $value, $tcaFieldConf, $PP, $field = '')
{
GeneralUtility::logDeprecatedFunction();
return $this->checkValueForText($value, $tcaFieldConf);
}
/**
* Evaluate "text" type values.
*
......@@ -1790,24 +1737,6 @@ class DataHandler
return $this->checkValue_text_Eval($value, $evalCodesArray, $tcaFieldConf['is_in']);
}
/**
* Evaluate "input" type values.
*
* @param array $res The result array. The processed value (if any!) is set in the "value" key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @param string $field Field name
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_input($res, $value, $tcaFieldConf, $PP, $field = '')
{
GeneralUtility::logDeprecatedFunction();
list($table, $id, , , $realPid) = $PP;
return $this->checkValueForInput($value, $tcaFieldConf, $table, $id, $realPid, $field);
}
/**
* Evaluate "input" type values.
*
......@@ -1885,24 +1814,6 @@ class DataHandler
return $res;
}
/**
* Evaluates 'check' type values.
*
* @param array $res The result array. The processed value (if any!) is set in the 'value' key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @param string $field Field name
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_check($res, $value, $tcaFieldConf, $PP, $field = '')
{
GeneralUtility::logDeprecatedFunction();
list($table, $id, , , $realPid) = $PP;
return $this->checkValueForCheck($res, $value, $tcaFieldConf, $table, $id, $realPid, $field);
}
/**
* Evaluates 'check' type values.
*
......@@ -1954,23 +1865,6 @@ class DataHandler
return $res;
}
/**
* Evaluates 'radio' type values.
*
* @param array $res The result array. The processed value (if any!) is set in the 'value' key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_radio($res, $value, $tcaFieldConf, $PP)
{
GeneralUtility::logDeprecatedFunction();
// TODO find a way to get the field name; it should not be set in $recFID as this is only created for some record types, see checkValue()
return $this->checkValueForRadio($res, $value, $tcaFieldConf, $PP[0], $PP[1], $PP[4], '');
}
/**
* Evaluates 'radio' type values.
*
......@@ -2011,25 +1905,6 @@ class DataHandler
return $res;
}
/**
* Evaluates 'group' or 'select' type values.
*
* @param array $res The result array. The processed value (if any!) is set in the 'value' key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @param array $uploadedFiles
* @param string $field Field name
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_group_select($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
{
GeneralUtility::logDeprecatedFunction();
list($table, $id, $curValue, $status, , $recFID) = $PP;
return $this->checkValueForGroupSelect($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $recFID, $uploadedFiles, $field);
}
/**
* Evaluates 'group' or 'select' type values.
*
......@@ -2168,7 +2043,6 @@ class DataHandler
* @return array Modified value array
*
* @throws \RuntimeException
* @see checkValue_group_select()
*/
public function checkValue_group_select_file($valueArray, $tcaFieldConf, $curValue, $uploadedFileArray, $status, $table, $id, $recFID)
{
......@@ -2191,7 +2065,6 @@ class DataHandler
// Creating fileFunc object.
if (!$this->fileFunc) {
$this->fileFunc = GeneralUtility::makeInstance(BasicFileUtility::class);
$this->include_filefunctions = 1;
}
// Setting permitted extensions.
$all_files = array();
......@@ -2439,25 +2312,6 @@ class DataHandler
return $valueArray;
}
/**
* Evaluates 'flex' type values.
*
* @param array $res The result array. The processed value (if any!) is set in the 'value' key.
* @param string|array $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param array $PP Additional parameters in a numeric array: $table,$id,$curValue,$status,$realPid,$recFID
* @param array $uploadedFiles Uploaded files for the field
* @param string $field Field name
* @return array Modified $res array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function checkValue_flex($res, $value, $tcaFieldConf, $PP, $uploadedFiles, $field)
{
GeneralUtility::logDeprecatedFunction();
list($table, $id, $curValue, $status, $realPid, $recFID, $tscPID) = $PP;
$this->checkValueForFlex($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $realPid, $recFID, $tscPID, $uploadedFiles, $field);
}
/**
* Evaluates 'flex' type values.
*
......@@ -2489,10 +2343,6 @@ class DataHandler
if (!is_array($currentValueArray)) {
$currentValueArray = array();
}
if (isset($currentValueArray['meta']['currentLangId'])) {
// @deprecated call since TYPO3 7, will be removed with TYPO3 8
unset($currentValueArray['meta']['currentLangId']);
}
// Remove all old meta for languages...
// Evaluation of input values:
$value['data'] = $this->checkValue_flex_procInData($value['data'], $currentValueArray['data'], $uploadedFiles['data'], $dataStructArray, array($table, $id, $curValue, $status, $realPid, $recFID, $tscPID));
......@@ -3134,10 +2984,7 @@ class DataHandler
// Finally, check if new and old values are different (or no .vDEFbase value is found) and if so, we record the vDEF value for diff'ing.
// We do this after $dataValues has been updated since I expect that $dataValues_current holds evaluated values from database (so this must be the right value to compare with).
if (substr($vKey, -9) != '.vDEFbase') {
// @deprecated: flexFormXMLincludeDiffBase is only enabled by ext:compatibility6 since TYPO3 CMS 7, vDEFbase can be unset / ignored with TYPO3 CMS 8
if ($this->clear_flexFormData_vDEFbase) {
$dataValues[$key][$vKey . '.vDEFbase'] = '';
} elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && ((string)$dataValues[$key][$vKey] !== (string)$dataValues_current[$key][$vKey] || !isset($dataValues_current[$key][$vKey . '.vDEFbase']) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
if ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && ((string)$dataValues[$key][$vKey] !== (string)$dataValues_current[$key][$vKey] || !isset($dataValues_current[$key][$vKey . '.vDEFbase']) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
// Now, check if a vDEF value is submitted in the input data, if so we expect this has been processed prior to this operation (normally the case since those fields are higher in the form) and we can use that:
if (isset($dataValues[$key]['vDEF'])) {
$diffValue = $dataValues[$key]['vDEF'];
......@@ -4050,7 +3897,6 @@ class DataHandler
// Creating fileFunc object.
if (!$this->fileFunc) {
$this->fileFunc = GeneralUtility::makeInstance(BasicFileUtility::class);
$this->include_filefunctions = 1;
}
// Select all RTEmagic files in the reference table from the table/ID
$where = join(' AND ', array(
......@@ -4792,7 +4638,6 @@ class DataHandler
if (is_array($removeArray) && !empty($removeArray)) {
/** @var DataHandler $tce */
$tce = GeneralUtility::makeInstance(__CLASS__);
$tce->stripslashes_values = false;
$tce->start(array(), $removeArray);
$tce->process_cmdmap();
unset($tce);
......@@ -5170,7 +5015,6 @@ class DataHandler
);
/** @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(__CLASS__);
$dataHandler->stripslashes_values = false;
$dataHandler->neverHideAtCopy = true;
$dataHandler->start(array(), $command);
$dataHandler->process_cmdmap();
......@@ -5620,19 +5464,16 @@ class DataHandler
/**
* Returns an instance of DataHandler for handling local datamaps/cmdmaps
*
* @param bool $stripslashesValues If TRUE, incoming values in the data-array have their slashes stripped.
* @param bool $dontProcessTransformations If set, then transformations are NOT performed on the input.
* @return DataHandler
*/
protected function getLocalTCE($stripslashesValues = false, $dontProcessTransformations = true)
protected function getLocalTCE()
{
$copyTCE = GeneralUtility::makeInstance(__CLASS__);
$copyTCE->stripslashes_values = $stripslashesValues;
$copyTCE->copyTree = $this->copyTree;
// Copy forth the cached TSconfig
$copyTCE->cachedTSconfig = $this->cachedTSconfig;
// Transformations should NOT be carried out during copy
$copyTCE->dontProcessTransformations = $dontProcessTransformations;
$copyTCE->dontProcessTransformations = true;
return $copyTCE;
}
......@@ -8070,10 +7911,6 @@ class DataHandler
*/
public function newlog2($message, $table, $uid, $pid = null, $error = 0)
{
if ($pid === false) {
GeneralUtility::deprecationLog('Setting the $pid parameter of DataHandler::newlog2 to FALSE is deprecated since TYPO3 CMS 7. Either provide an integer or NULL. FALSE will not be supported any more in TYPO3 CMS 8');
$pid = null;
}
if (is_null($pid)) {
$propArr = $this->getRecordProperties($table, $uid);
$pid = $propArr['pid'];
......
......@@ -891,7 +891,6 @@ class ReferenceIndex
} else {
// Execute CMD array:
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->stripslashes_values = false;
$dataHandler->dontProcessTransformations = true;
$dataHandler->bypassWorkspaceRestrictions = true;
$dataHandler->bypassFileHandling = true;
......
......@@ -581,7 +581,6 @@ class FrontendEditingController
{
if (!isset($this->tce)) {
$this->tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$this->tce->stripslashes_values = 0;
}
}
}
===========================================================
Breaking: #72385 - Removed deprecated code from DataHandler
===========================================================
Description
===========
Removed deprecated code from DataHandler
The following properties have been removed:
``stripslashes_values``
``clear_flexFormData_vDEFbase``
``include_filefunctions``
The following methods have been removed:
``checkValue_text()``
``checkValue_input()``
``checkValue_check()``
``checkValue_radio()``
``checkValue_group_select()``
``checkValue_flex()``
Additionally, the method ``getLocalTCE()`` does not accept any parameter now anymore.
Impact
======
Using one of these methods or properties will throw a fatal error.
Affected Installations
======================
An extension relying on one of these public properties or methods will fail.
Migration
=========
These functions are internal and should not be used outside of the core.
\ No newline at end of file
......@@ -85,7 +85,6 @@ class ContentRepository
// Make TCEmain object:
/** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
$tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = 0;
// Put content into the data array:
$data = array();
$data[$parameters['table']][$parameters['uid']][$parameters['field']] = $typoscript;
......
......@@ -2267,7 +2267,6 @@ class ImportExport
public function getNewTCE()
{
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
$tce->dontProcessTransformations = 1;
$tce->enableLogging = $this->enableLogging;
$tce->alternativeFileName = $this->alternativeFileName;
......
......@@ -528,7 +528,6 @@ class AdministrationRepository
$data = array();
$data['pages'][$pageId]['keywords'] = implode(', ', array_keys($keywords));
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->stripslashes_values = 0;
$dataHandler->start($data, array());
$dataHandler->process_datamap();
}
......
......@@ -128,7 +128,6 @@ Cleaning XML for FlexForm fields.
}
// Execute Data array:
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = false;
$tce->dontProcessTransformations = true;
$tce->bypassWorkspaceRestrictions = true;
$tce->bypassFileHandling = true;
......
......@@ -94,7 +94,6 @@ Although deleted records are not errors to be repaired, this tool allows you to
} else {
// Execute CMD array:
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = false;
$tce->start(array(), array());
// Notice, we are deleting pages with no regard to subpages/subrecords - we do this since they
// should also be included in the set of deleted pages of course (no un-deleted record can exist
......
......@@ -119,7 +119,6 @@ Will report orphan uids from TCA tables.';
} else {
// Execute CMD array:
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
$tce->stripslashes_values = false;
$tce->start(array(), array());
// Notice, we are deleting pages with no regard to subpages/subrecords - we do this
// since they should also be included in the set of orphans of course!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment