Bug #16176 » bug_3544.diff
t3lib/class.t3lib_befunc.php (Arbeitskopie) | ||
---|---|---|
}
|
||
// ... 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,'pid,t3ver_oid'); // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing...
|
||
// First, check if the pid is -1 => it is a record in a draft workspace => get the "real" record
|
||
if (is_array($rr) && $rr['pid']=='-1') {
|
||
$rr = t3lib_BEfunc::getRecord($table,$rr['t3ver_oid'],'pid');
|
||
}
|
||
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.
|
||
$thePidValue = $rr['pid']; // Return the "pid" of the record
|
||
} else $thePidValue = -1; // Return "-1" if the record with the pid was not found
|
||
}
|
||
return $thePidValue;
|