Bug #16652 » rec_field.patch
t3lib/class.t3lib_befunc.php (working copy) | ||
---|---|---|
$fTWHERE = $fieldValue['config'][$prefix.'foreign_table_where'];
|
||
if (strstr($fTWHERE,'###REC_FIELD_')) {
|
||
$fTWHERE_parts = explode('###REC_FIELD_',$fTWHERE);
|
||
while(list($kk,$vv)=each($fTWHERE_parts)) {
|
||
|
||
foreach($fTWHERE_parts as $kk => $vv) {
|
||
if ($kk) {
|
||
$fTWHERE_subpart = explode('###',$vv,2);
|
||
// For new records, which are not saved yet, $TSconfig['_THIS_ROW'][$fTWHERE_subpart[0]] may be empty.
|
||
// This will cause SQL errors until the record has been saved for the first time.
|
||
// Setting the value to 0 if it is empty.
|
||
// @TODO: Needs a better fix.
|
||
if (empty($TSconfig['_THIS_ROW'][$fTWHERE_subpart[0]])) {
|
||
$TSconfig['_THIS_ROW'][$fTWHERE_subpart[0]] = 0;
|
||
}
|
||
$fTWHERE_parts[$kk]=$TSconfig['_THIS_ROW'][$fTWHERE_subpart[0]].$fTWHERE_subpart[1];
|
||
}
|
||
}
|