Project

General

Profile

Bug #92093 ยป sorting_PPS-1552.patch

Markus Gerdes, 2020-08-25 09:45

View differences:

typo3/sysext/core/Classes/DataHandling/DataHandler.php (date 1590700172005)
$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'],
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT, ':pointer')
)
);
if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
......
$localizedDestPids = [];
// If $$originalRecordDestinationPid < 0, then it is the uid of the original language record we are inserting after
if ($originalRecordDestinationPid < 0) {
// respect all (-1) language
$queryBuilder->orWhere(
$queryBuilder->expr()->andX(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT, ':pointer')),
$queryBuilder->expr()->eq('sys_language_uid', -1)
)
);
// Get the localized records of the record we are inserting after
$queryBuilder->setParameter('pointer', abs($originalRecordDestinationPid), \PDO::PARAM_INT);
$destL10nRecords = $queryBuilder->execute()->fetchAll();
......
// Move the localized records after the corresponding localizations of the destination record
foreach ($l10nRecords as $record) {
$localizedDestPid = (int)$localizedDestPids[$record[$GLOBALS['TCA'][$table]['ctrl']['languageField']]];
if ($localizedDestPid === 0 && $record[$GLOBALS['TCA'][$table]['ctrl']['languageField']] !== -1 && array_key_exists(-1, $localizedDestPids)){
$localizedDestPid = $localizedDestPids[-1];
}
if ($localizedDestPid < 0) {
$this->moveRecord($table, $record['uid'], $localizedDestPid);
} else {
    (1-1/1)