Reverting previous revision 8454 in authority of Steffen
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 30 Jul 2010 20:41:26 +0000 (20:41 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 30 Jul 2010 20:41:26 +0000 (20:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8455 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tcemain.php

index 1a2c7f4..7726685 100644 (file)
@@ -678,6 +678,7 @@ class t3lib_TCEmain {
                                                        // ******************************
                                                $createNewVersion = FALSE;
                                                $recordAccess = FALSE;
+                                               $old_pid_value = '';
                                                $this->autoVersioningUpdate = FALSE;
 
                                                if (!t3lib_div::testInt($id)) {               // Is it a new record? (Then Id is a string)
@@ -691,6 +692,7 @@ class t3lib_TCEmain {
                                                                if (strstr($pid_value,'NEW'))   {       // If a NEW... id
                                                                        if (substr($pid_value,0,1)=='-') {$negFlag=-1;$pid_value=substr($pid_value,1);} else {$negFlag=1;}
                                                                        if (isset($this->substNEWwithIDs[$pid_value]))  {       // Trying to find the correct numerical value as it should be mapped by earlier processing of another new record.
+                                                                               $old_pid_value = $pid_value;
                                                                                $pid_value=intval($negFlag*$this->substNEWwithIDs[$pid_value]);
                                                                        } else {$OK = 0;}       // If not found in the substArray we must stop the process...
                                                                } elseif ($pid_value>=0 && $this->BE_USER->workspace!==0 && $TCA[$table]['ctrl']['versioning_followPages'])     {       // PID points to page, the workspace is an offline space and the table follows page during versioning: This means we must check if the PID page has a version in the workspace with swapmode set to 0 (zero = page+content) and if so, change the pid to the uid of that version.
@@ -832,7 +834,7 @@ class t3lib_TCEmain {
                                                        // If access was granted above, proceed to create or update record:
                                                if ($recordAccess)      {
 
-                                                       list($tscPID) = t3lib_BEfunc::getTSCpid($table, $id, $fieldArray['pid']);
+                                                       list($tscPID) = t3lib_BEfunc::getTSCpid($table,$id,$old_pid_value ? $old_pid_value : $fieldArray['pid']);       // Here the "pid" is set IF NOT the old pid was a string pointing to a place in the subst-id array.
                                                        $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
                                                        if ($status=='new' && $table=='pages' && is_array($TSConfig['permissions.']))   {
                                                                $fieldArray = $this->setTSconfigPermissions($fieldArray,$TSConfig['permissions.']);