Issue Bug Closed

#43114sanitizeSelectPart - select CONTENT using DISTINCT

GAYA La Nouvelle Agence 11/19/12, 20:04 updated 04/01/20, 21:14

Description

Hi,

I’ve encounter a problem while upgrading to 4.5.22. The sanitizeSelectPart() method was introduced (backported from 4.6 I think) and poses a new problem while using DISTINCT directive. Ex :

test = CONTENT
test {
table = tx_test
select.selectFields = DISTINCT as test
}

The sanitizeSelectPart method will add uid and pid in select clause and so… it won’t do what we expect
I saw that some exception was already introduced (count|max|min|avg|sum). Adding distinct will solved the problem.

I don’t understand why these “necessaryFields” (uid, pid) were introduced cause in many cases they are not necessary, but this method doesn’t smell good and adding some exceptions like it was already done smell worse…

Reviews 2