Project

General

Profile

Bug #16652 » TYPO3_4-1-rec_field.patch

Administrator Admin, 2009-07-03 10:21

View differences:

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)) {
$fTWHERE_parts = explode('###REC_FIELD_',$fTWHERE);
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.
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];
}
}
(2-2/4)