[BUGFIX] Consider placeholders in fixVersioningPid 48/42548/2
authorTimo Webler <timo.webler@dkd.de>
Wed, 11 Sep 2013 13:43:25 +0000 (15:43 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 12 Aug 2015 19:55:53 +0000 (21:55 +0200)
Method fixVersioningPid does not analyze the new location for an element.
Check for a move placeholder to get the new location.
Same behavior as in frontend.
See \TYPO3\CMS\Frontend\Page\PageRepository::fixVersioningPid

Resolves: #51913
Releases: master, 6.2
Change-Id: I08a8eab714ec1530f3c655f0440c98342120e328
Reviewed-on: http://review.typo3.org/42548
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 40cd385..757be59 100644 (file)
@@ -3862,6 +3862,17 @@ class BackendUtility {
                                                $rr['pid'] = $oidRec['pid'];
                                        }
                                }
+                               // Use target PID in case of move pointer
+                               if (
+                                       !isset($rr['t3ver_state'])
+                                       || VersionState::cast($rr['t3ver_state'])->equals(VersionState::MOVE_POINTER)
+                               ) {
+                                       $movePlaceholder = self::getMovePlaceholder($table, $oid, 'pid');
+                                       if ($movePlaceholder) {
+                                               $rr['_ORIG_pid'] = $rr['pid'];
+                                               $rr['pid'] = $movePlaceholder['pid'];
+                                       }
+                               }
                        }
                }
        }