[BUGFIX] Pagetree - Prevent a call to moveNode while creating nodes
authorTobias Schultheiss <t.schultheiss@digital-worx.de>
Thu, 16 Aug 2012 14:54:56 +0000 (16:54 +0200)
committerXavier Perseguers <xavier@typo3.org>
Tue, 16 Oct 2012 08:54:44 +0000 (10:54 +0200)
Change-Id: I355cfb5ed4d2ebfac26376f5f774dca4d89a0c6c
Fixes: #39820
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/15555
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/tree/pagetree/class.t3lib_tree_pagetree_commands.php

index e140490..3bf72ea 100644 (file)
@@ -139,10 +139,14 @@ final class t3lib_tree_pagetree_Commands {
                        'doktype' => $pageType,
                        'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tree.defaultPageTitle', TRUE),
                );
+
+               $pid = intval($parentNode->getWorkspaceId());
+               $targetId = intval($targetId);
+
                $newPageId = self::processTceCmdAndDataMap(array(), $data);
                $node = self::getNode($newPageId[$placeholder]);
 
-               if ($parentNode->getWorkspaceId() !== $targetId) {
+               if ($pid !== $targetId) {
                        self::moveNode($node, $targetId);
                }