Bug #16652

mysql_fetch_assoc If in tca select->maxitems > 1 AND foreign_table_where contains "sys_language_uid = ###REC_FIELD_sys_langu...

Added by Sascha Egerer almost 15 years ago. Updated almost 8 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


I have createt an extension. When I write the following in the tca.php File I get the an error:
"config" => Array (
"type" => "select",
"foreign_table" => "xxx",
"foreign_table_where" => "AND xxx.sys_language_uid = ###REC_FIELD_sys_language_uid### ORDER BY xxx.name",
"maxitems" => 100,

I get this error if I create a record of this type:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in xxx/htdocs/typo3_src-4.0/t3lib/class.t3lib_db.php on line 801

The error comes only if "###REC_FIELD_sys_language_uid### " is in the "foreign_table_where" AND "maxitems" is higher then 1.
If I set "maxitems" = 1 or I delete the part "AND xxx.sys_language_uid = ###REC_FIELD_sys_language_uid###" the error does not come.

(sorry if my english is not so good.... ;-) )

(issue imported from #M4405)


rec_field.patch (1.04 KB) rec_field.patch Administrator Admin, 2008-04-30 12:02
TYPO3_4-1-rec_field.patch (1.08 KB) TYPO3_4-1-rec_field.patch Administrator Admin, 2009-07-03 10:21
TYPO3_4-2-rec_field.patch (1.21 KB) TYPO3_4-2-rec_field.patch Administrator Admin, 2009-07-03 10:22
TYPO3_trunk-rec_field.patch (1.21 KB) TYPO3_trunk-rec_field.patch Administrator Admin, 2009-07-03 10:22

Related issues

Related to TYPO3 Core - Feature #17500: Localization of child recordsClosedOliver Hader2007-08-06


Updated by Sascha Egerer almost 15 years ago

Sorry I've forgot something.
This error only comes if I create a new record. If I press the save Button or edit an existing record then comes no error.
Maybe the "###REC_FIELD_sys_language_uid###" marker is not set correctly if
- the record is not saved
- maxitems is 1


Updated by Steffen Kamper over 14 years ago


i found a workaround - I use this expression:

So if the marker is empty it will be converted to 0


Updated by Andreas Otto † about 13 years ago

Hi Steffen,

your workaround sounds good.

Is the cast expression standard sql?


Updated by Andreas Otto † about 13 years ago

A while ago I created a patch for the 4.1 branch.
Maybe the patch is of help.


Updated by Andreas Otto † about 12 years ago

I have added patches for trunk (4.3), 4.2 and 4.1 which correct the odd situation.


Updated by Andreas Otto † about 12 years ago

As mentioned in my note from 2008-04-30 this can easily be fixed with the patches attached.

This odd situation does only appear if you use a ###REC_FIELD_*### marker inside the foreign_table_where configuration.

$TCA['tx_faqs']['columns']['similar_faq']['config']['foreign_table_where'] = ' AND tx_faqs.deleted=0 AND tx_faqs.pid IN (103) AND tx_faqs.sys_language_uid=###REC_FIELD_sys_language_uid### ORDER BY tx_faqs.question ASC'

The example above would only list other records if they have the same sys_language_uid which keeps the list smaller if you have more than 2 languages on your TYPO3 installation.


Updated by Andreas Otto † almost 12 years ago

Unassigning the issue from myself.


Updated by Alexander Opitz about 8 years ago

  • Status changed from Accepted to Needs Feedback
  • Target version deleted (0)

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?


Updated by Alexander Opitz almost 8 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Also available in: Atom PDF