Bug #16546
closedediting template causes SQL error ' FROM ,pages'
0%
Description
When I click in the template module to edit a template then I get MYSQL error messages.
The reason for this is line 800 in file t3lib/class.t3lib_transferdata.php.
// neg_foreign_table
if (is_array($TCA[$fieldConfig['config']['neg_foreign_table']])) {
$subres = t3lib_BEfunc::exec_foreign_table_where_query($fieldConfig,$field,$TSconfig,'neg_');
while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subres)) {
$recordList[-$subrow['uid']] = t3lib_BEfunc::getRecordTitle($fieldConfig['config']['neg_foreign_table'],$subrow);
}
}
Due to some error which I will investigate further, there happens to be a $TCA['NULL] array.
$TCA
Array (1)
Array (1) columns
Array (1) category
Array (11) config Array not debugged. Set higher "level" if you want to debug this.
So we need an additional
if ($fieldConfig['config']['neg_foreign_table'])
(issue imported from #M4188)
Files
Updated by Franz Holzinger about 18 years ago
The original reason for this error is a wrong assignement in an extension which has assigned
an array to $TCA[NULL].
I think that this bug should not have such consequences.
Updated by Franz Holzinger almost 18 years ago
Hello Michael,
please let me fix this somehow.
I have lost again some hours due to this codeline in t3lib_transferData::selectAddForeign:
// neg_foreign_table
if (is_array($TCA[$fieldConfig['config']['neg_foreign_table']])) {
$subres = t3lib_BEfunc::exec_foreign_table_where_query($fieldConfig,$field,$TSconfig,'neg_');
while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subres)) {
$recordList[-$subrow['uid']] = t3lib_BEfunc::getRecordTitle($fieldConfig['config']['neg_foreign_table'],$subrow);
}
}
This happens when an extension has an error inside of it. Then it really hard to debug for the reason of this.
Updated by Christian Kuhn almost 16 years ago
No feedback for a long time.
Please reopen if you still think this is an error in current TYPO3 core.