Project

General

Profile

Actions

Bug #20491

closed

Wrong substitution of ###THIS_UID### in t3lib_loaddbgroup.php

Added by Jo Hasenau over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-05-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

class.t3lib_loaddbgroup.php.diff (646 Bytes) class.t3lib_loaddbgroup.php.diff Administrator Admin, 2009-09-15 14:18
11168.diff (630 Bytes) 11168.diff Administrator Admin, 2009-11-03 16:51
11168_v2.diff (636 Bytes) 11168_v2.diff Administrator Admin, 2009-11-03 17:11
Actions #1

Updated by Jo Hasenau about 15 years ago

Attached a patch against TRUNK revision 5928

Actions #2

Updated by Oliver Hader about 15 years ago

Hi Joey,
I guess this behaviour also exists in TYPO3 4.2, doesn't it?

Actions #3

Updated by Jo Hasenau about 15 years ago

Haven't got a test scenario available now, but according to the additional information it should ;-)

Actions #4

Updated by Oliver Hader about 15 years ago

Ah, overlooked the additional information... thanks! ;-)

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Steffen Kamper about 15 years ago

committed to trunk rev 6344

Actions

Also available in: Atom PDF