[BUGFIX] Pagetree - Prevent a call to moveNode while creating nodes 42/17642/2
authorTobias Schultheiss <t.schultheiss@digital-worx.de>
Thu, 16 Aug 2012 14:54:56 +0000 (16:54 +0200)
committerBenjamin Mack <benni@typo3.org>
Sun, 7 Apr 2013 08:49:16 +0000 (10:49 +0200)
Change-Id: I355cfb5ed4d2ebfac26376f5f774dca4d89a0c6c
Fixes: #39820
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: https://review.typo3.org/17642
Reviewed-by: Mario Rimann
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
t3lib/tree/pagetree/class.t3lib_tree_pagetree_commands.php

index 5e7456a..8935a8f 100644 (file)
@@ -148,10 +148,13 @@ final class t3lib_tree_pagetree_Commands {
                $data['pages'][$placeholder]['doktype'] = $pageType;
                $data['pages'][$placeholder]['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);
                }