Skip to content

Commit

Permalink
[TASK] Remove unused DH $remapStackChildIds
Browse files Browse the repository at this point in the history
In this episode of 'Cracking the Cryptic' we are
looking at the DataHandler puzzle ;)
Let's get some obvious things done, first:

Protected property DataHandler->remapStackChildIds
is only written but never read. Remove property
and protected addNewValuesToRemapStackChildIds()
with all its callers to reduce complexity a bit.

Resolves: #103132
Releases: main
Change-Id: I914ae36875906acc8e39799e640899116b3206ee
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83015
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Kienast <a.fernandez@scripting-base.de>
Tested-by: Andreas Kienast <a.fernandez@scripting-base.de>
  • Loading branch information
lolli42 committed Feb 15, 2024
1 parent 7177ce3 commit 38ea522
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -496,13 +496,6 @@ class DataHandler implements LoggerAwareInterface
*/
public $remapStackRecords = [];

/**
* Array used for checking whether new children need to be remapped
*
* @var array
*/
protected $remapStackChildIds = [];

/**
* Array used for executing addition actions after remapping happened (set processRemapStack())
*
Expand Down Expand Up @@ -1601,7 +1594,6 @@ protected function checkValueForInternalReferences(array $res, $value, $tcaField

$valueArray = [$value];
$this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = [
'args' => [$valueArray, $tcaFieldConf, $id, $table, $field],
'pos' => ['valueArray' => 0, 'tcaFieldConf' => 1, 'id' => 2, 'table' => 3],
Expand Down Expand Up @@ -2121,7 +2113,6 @@ protected function checkValueForCategory(
$unsetResult = false;
if (str_contains($value, 'NEW')) {
$this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = [
'func' => 'checkValue_category_processDBdata',
'args' => [$valueArray, $tcaFieldConf, $id, $status, $table, $field],
Expand Down Expand Up @@ -2465,7 +2456,6 @@ protected function checkValueForGroupFolderSelect($res, $value, $tcaFieldConf, $
// check, if there is a NEW... id in the value, that should be substituted later
if (str_contains($value, 'NEW')) {
$this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = [
'func' => 'checkValue_group_select_processDBdata',
'args' => [$valueArray, $tcaFieldConf, $id, $status, $tcaFieldConf['type'], $table, $field],
Expand Down Expand Up @@ -2733,7 +2723,6 @@ public function checkValueForInline($res, $value, $tcaFieldConf, $table, $id, $s
// We need to decide whether we use the stack or can save the relation directly.
if (!empty($value) && (str_contains($value, 'NEW') || !MathUtility::canBeInterpretedAsInteger($id))) {
$this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = [
'func' => 'checkValue_inline_processDBdata',
'args' => [$valueArray, $tcaFieldConf, $id, $status, $table, $field, $additionalData],
Expand Down Expand Up @@ -2763,7 +2752,6 @@ public function checkValueForFile(
$valueArray = array_unique(GeneralUtility::trimExplode(',', $value));
if ($value !== '' && (str_contains($value, 'NEW') || !MathUtility::canBeInterpretedAsInteger($id))) {
$this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = [
'func' => 'checkValue_file_processDBdata',
'args' => [$valueArray, $tcaFieldConf, $id, $table],
Expand Down Expand Up @@ -9460,20 +9448,6 @@ protected function overlayAutoVersionId($table, $id)
return $id;
}

/**
* Adds new values to the remapStackChildIds array.
*
* @param array $idValues uid values
*/
protected function addNewValuesToRemapStackChildIds(array $idValues)
{
foreach ($idValues as $idValue) {
if (str_starts_with($idValue, 'NEW')) {
$this->remapStackChildIds[$idValue] = true;
}
}
}

/**
* Resolves versioned records for the current workspace scope.
* Delete placeholders are substituted and removed.
Expand Down

0 comments on commit 38ea522

Please sign in to comment.