Fixed bug #3544: RTE-config in PageTS-config not loaded when in draft-workspace
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 6 Jul 2007 10:22:14 +0000 (10:22 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 6 Jul 2007 10:22:14 +0000 (10:22 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-0@2378 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index 0d53e59..39b976f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-06  Michael Stucki  <michael@typo3.org>
+
+       * Fixed bug #3544: RTE-config in PageTS-config not loaded when in draft-workspace
+
 2007-07-02  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #4623: Content encoding with x-gzip not possible in IE7
index abfe173..bdb594d 100755 (executable)
@@ -2817,10 +2817,21 @@ class t3lib_BEfunc      {
                        }
                        // ... else the pos/zero pid is just returned here.
                } else {        // No integer pid and we are forced to look up the $pid
-                       $rr = t3lib_BEfunc::getRecord($table,$uid,'pid');       // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing...
+                       $rr = t3lib_BEfunc::getRecord($table,$uid);     // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing...
+
                        if (is_array($rr))      {
-                               $thePidValue = $rr['pid'];      // Returning the 'pid' of the record
-                       } else $thePidValue=-1; // Returns -1 if the record with the pid was not found.
+                                       // First check if the pid is -1 which means it is a workspaced element. Get the "real" record:
+                               if ($rr['pid']=='-1')   {
+                                       $rr = t3lib_BEfunc::getRecord($table,$rr['t3ver_oid'],'pid');
+                                       if (is_array($rr))      {
+                                               $thePidValue = $rr['pid'];
+                                       }
+                               } else {
+                                       $thePidValue = $rr['pid'];      // Returning the "pid" of the record
+                               }
+                       }
+
+                       if (!$thePidValue)      $thePidValue = -1;      // Returns -1 if the record with this pid was not found.
                }
 
                return $thePidValue;