Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use the _ for new identifier in DataHandler #21

Open
DanielSiepmann opened this issue Apr 27, 2021 · 0 comments
Open

Do not use the _ for new identifier in DataHandler #21

DanielSiepmann opened this issue Apr 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@DanielSiepmann
Copy link
Contributor

The _ inside the uid has a special meaning, see

if (strpos($value, '_') === false) {
    $affectedTable = $tcaFieldConf['foreign_table'];
    $prependTable = false;
} else {
    $parts = explode('_', $value);
    $value = array_pop($parts);
    $affectedTable = implode('_', $parts);
    $prependTable = true;
}
$value = $this->substNEWwithIDs[$value];
// The record is new, but was also auto-versionized and has another new id:
if (isset($this->autoVersionIdMap[$affectedTable][$value])) {
    $value = $this->autoVersionIdMap[$affectedTable][$value];
}
if ($prependTable) {
    $value = $affectedTable . '_' . $value;
}
// Set a hint that this was a new child record:
$this->newRelatedIDs[$affectedTable][] = $value;
$valueArray[$key] = $value;

https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L6249

We should not use the _ to follow the documented and expected behaviour.

The _ has no consequences right now, because we do not use the uids in relations yet. But this might change in the future and would result in broken behaviour.

@DanielSiepmann DanielSiepmann added the enhancement New feature or request label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant