Project

General

Profile

Bug #16845 » typo3core_bugfix_4759_trunk_v2.patch

Administrator Admin, 2011-01-26 17:43

View differences:

t3lib/class.t3lib_tcemain.php (copie de travail)
$this->moveRecord_procFields($table, $uid, $destPid);
// Create query for update:
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($uid), $updateFields);
// check for the localizations of that element
$this->moveL10nOverlayRecords($table, $uid, $destPid);
// Move the localizations of that element just after the element
$this->moveL10nOverlayRecords($table, $uid, -$uid);
// Call post processing hooks:
foreach ($hookObjectsArr as $hookObj) {
......
}
$this->clear_cache($table, $uid); // clear cache after moving
$this->fixUniqueInPid($table, $uid);
// fixCopyAfterDuplFields
if ($origDestPid < 0) {
$this->fixCopyAfterDuplFields($table, $uid, abs($origDestPid), 1);
} // origDestPid is retrieve before it may possibly be converted to resolvePid if the table is not sorted anyway. In this way, copying records to after another records which are not sorted still lets you use this function in order to copy fields from the one before.
} else {
$destPropArr = $this->getRecordProperties('pages', $destPid);
$this->log($table, $uid, 4, 0, 1, "Attempt to move page '%s' (%s) to inside of its own rootline (at page '%s' (%s))", 10, array($propArr['header'], $uid, $destPropArr['header'], $destPid), $propArr['pid']);
......
$this->moveRecord_procFields($table, $uid, $destPid);
// Create query for update:
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($uid), $updateFields);
// check for the localizations of that element
$this->moveL10nOverlayRecords($table, $uid, $destPid);
// Move the localizations of that element just after the element
$this->moveL10nOverlayRecords($table, $uid, -$uid);
// Call post processing hooks:
foreach ($hookObjectsArr as $hookObj) {
......
// fixUniqueInPid
$this->fixUniqueInPid($table, $uid);
// fixCopyAfterDuplFields
if ($origDestPid < 0) {
$this->fixCopyAfterDuplFields($table, $uid, abs($origDestPid), 1);
}
} else {
$destPropArr = $this->getRecordProperties('pages', $destPid);
$this->log($table, $uid, 4, 0, 1, "Attempt to move page '%s' (%s) to inside of its own rootline (at page '%s' (%s))", 10, array($propArr['header'], $uid, $destPropArr['header'], $destPid), $propArr['pid']);
......
if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
$where = ' AND t3ver_oid=0';
}
$l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid, $where);
$l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid, $where, '', !empty($GLOBALS['TCA'][$table]['ctrl']['sortby']) ? $GLOBALS['TCA'][$table]['ctrl']['sortby'] : '');
if (is_array($l10nRecords)) {
foreach ($l10nRecords as $record) {
// Moving records to a positive destination will insert each
// record at the beginning, thus the order is reversed here:
foreach (array_reverse($l10nRecords) as $record) {
$this->moveRecord($table, $record['uid'], $destPid);
}
}
(2-2/4)