Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Listing module (Auflistung) has problem with expression in column list and where clauses #6337

Closed
ghost opened this issue Oct 21, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 21, 2013

(3.1.4)
When using an expression like

company,concat(lastname,', ',firstname) as "Name",city,phone

in the list_info field, column headings are incorrect.
mod_listing-head-with-expr

Caused in mod_listing.php - splitting the field list on commas fails here.
Solution: move THEAD code after TBODY code and use the column names actually returned by the query.

Note: A virtual column (like Nameabove) can still not be used in the query mask.
Solution: rewrite SQL generation for this case (subquery).

Also, inserting a condition like

1=1 OR 1=0

into the list_where fields results in wrong results as soon as a query mask ist added (the query mask condition is ignored). Any OR condition goes wrong.
Cause: the query mask condition is appended by AND, resulting in

1=1 OR 1=0 AND condition

which is TRUE always. It should read

(1=1 OR 1=0) AND condition

Same for list_info_where

@ghost
Copy link
Author

ghost commented Oct 21, 2013

I have already fixed the issues here and in #6338, and I am working to include #6332. After proper testing, I just will have to learn a bit more git to make the pull request.

@leofeyer
Copy link
Member

I'm closing the ticket in favor of #6344 then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant