From c48f4ba29ada2d5b472cc6211b21516bbdbd76c2 Mon Sep 17 00:00:00 2001 From: Francois Suter Date: Sun, 11 Apr 2010 16:13:05 +0000 Subject: [PATCH] Fixed bug #14005: Moving a page with IRRE records misplaces IRRE records git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7291 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ t3lib/class.t3lib_tcemain.php | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e50e71bb095..16aa317c577 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-04-06 Francois Suter + + * Fixed bug #14005: Moving a page with IRRE records misplaces IRRE records + 2010-04-11 Patrick Broens * Added feature #14064: Install tool refactoring diff --git a/t3lib/class.t3lib_tcemain.php b/t3lib/class.t3lib_tcemain.php index 2d817baef51..325b9238646 100644 --- a/t3lib/class.t3lib_tcemain.php +++ b/t3lib/class.t3lib_tcemain.php @@ -3798,11 +3798,11 @@ class t3lib_TCEmain { * @param array $conf: TCA configuration of current field * @return void */ - function moveRecord_procBasedOnFieldType($table,$uid,$destPid,$field,$value,$conf) { + function moveRecord_procBasedOnFieldType($table, $uid, $destPid, $field, $value, $conf) { $moveTable = ''; $moveIds = array(); - if ($conf['type'] == 'inline') { + if ($conf['type'] == 'inline') { $foreign_table = $conf['foreign_table']; $moveChildrenWithParent = (!isset($conf['behaviour']['disableMovingChildrenWithParent']) || !$conf['behaviour']['disableMovingChildrenWithParent']); @@ -3810,18 +3810,23 @@ class t3lib_TCEmain { $inlineType = $this->getInlineFieldType($conf); if ($inlineType == 'list' || $inlineType == 'field') { $moveTable = $foreign_table; + if ($table == 'pages') { + // If the inline elements are related to a page record, + // make sure they reside at that page and not at its parent + $destPid = $uid; + } $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); $dbAnalysis->start($value, $conf['foreign_table'], '', $uid, $table, $conf); } } } - // move the records + // Move the records if (isset($dbAnalysis)) { // Moving records to a positive destination will insert each // record at the beginning, thus the order is reversed here: foreach (array_reverse($dbAnalysis->itemArray) as $v) { - $this->moveRecord($v['table'],$v['id'],$destPid); + $this->moveRecord($v['table'], $v['id'], $destPid); } } } -- 2.20.1