[BUGFIX] Fix negativ pid when doing a positioned insert 19/46019/2
authorMarco Huber <mail@marco-huber.de>
Fri, 15 Jan 2016 20:20:20 +0000 (21:20 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 16 Jan 2016 16:09:20 +0000 (17:09 +0100)
If you insert a content element (or a page) at a concrete position f.e.
after content element 15 the value in $row['pid'] is -15.
But in $this->data we already have the real pid, so we can just use it.

Resolves: #72751
Releases: master,7.6
Change-Id: Ib441dacf68eebd377f48589b7aeff6af1159263d
Reviewed-on: https://review.typo3.org/45969
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
(cherry picked from commit 52b3f406c3ad16808c66cadd54d53657e4c2dce8)
Reviewed-on: https://review.typo3.org/46019

typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php

index 8d2be70..41dcb39 100644 (file)
@@ -221,7 +221,7 @@ class RichTextElement extends AbstractFormElement
 
         $this->resultArray = $this->initializeResultArray();
         $this->defaultExtras = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
-        $this->pidOfPageRecord = $table === 'pages' && MathUtility::canBeInterpretedAsInteger($row['uid']) ? (int)$row['uid'] : (int)$row['pid'];
+        $this->pidOfPageRecord = $this->data['effectivePid'];
         BackendUtility::fixVersioningPid($table, $row);
         $this->pidOfVersionedMotherRecord = (int)$row['pid'];
         $this->vanillaRteTsConfig = $backendUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($this->pidOfPageRecord));