Bug #20491
closedWrong substitution of ###THIS_UID### in t3lib_loaddbgroup.php
0%
Description
In the readMM method of class.t3lib_loaddbgroup.php there is a Variable $additionalWhere.
As the name already says, it is filled with different stuff to build an additional WHERE clause for a MySQL query.
In almost any case there is an AND added to the value of the variable before the additional stuff for the WHERE clause.
The only exception is in line 301, which is adding stuff to the value without putting an AND before it.
If this is the only part to be added to it, the whole WHERE clause will throw a MySQL error in line 309 due to a missing AND between uid_local=blah and $additionalWhere.
IMHO there should be a check for an existing AND in $additionalWhere before it is added to the WHERE clause of exec_SELECTquery in line 309 and if there is none, it should be added to $additionalWhere.
The bug is present in 4.2.6 as well.
it throws an error in some special situations:
i.e. when opening a translated content element using a powermail plugin if this content element can be tagged with the tagpack as well.
I checked the backtrace to be sure it's not a problem of the tagpack or powermail itself and finally came to line 301 in class.t3lib_loaddbgroup.php
(issue imported from #M11168)
Files
Updated by Jo Hasenau about 15 years ago
Attached a patch against TRUNK revision 5928
Updated by Oliver Hader about 15 years ago
Hi Joey,
I guess this behaviour also exists in TYPO3 4.2, doesn't it?
Updated by Jo Hasenau about 15 years ago
Haven't got a test scenario available now, but according to the additional information it should ;-)
Updated by Oliver Hader about 15 years ago
Ah, overlooked the additional information... thanks! ;-)
Updated by Steffen Kamper about 15 years ago
The patch is wrong. All what is done there is to replace marker ###THIS_UID### with the uid. The bug is to use $additionalWhere here, but it should be
$this->MM_table_where = str_replace('###THIS_UID###', intval($uid), $this->MM_table_where);
attached is the corrected patch.
I also renamed the topic to the correct Bug.
Updated by Steffen Kamper about 15 years ago
ok, sorry, didn't recognized that $this->MM_table_where never used in SQL-query.
So i come back to Joey's solution but without the linebreak.