Then I got the idea of sorting the data in list view based on the person's name. So I put this at the top of the fields.ini file for the parent "people" table, which contains the name data:
- Code: Select all
__sql__="SELECT p.* FROM people p ORDER BY p.surname asc, p.given_names asc"
When I click on the "people" tab in XF, I indeed get a list of all the people, ordered by name. However, when I click on the "faculty" tab, I the following expression on an otherwise blank screen:
- Code: Select all
SELECT COUNT(*) FROM (select * from `faculty` as `t___child` left join (SELECT p.* FROM people p ORDER BY p.surname asc, p.given_names) as as `t___parent` on (`t___child`.`people_id`=`t___parent`.`id`)) as `faculty`
Notice that there is an error in the SQL code. Immediately following the inner SELECT expression (in parentheses) there is an "as as". I cut/pasted the SQL code into MySQL and of course it failed. I then deleted one of the "as"-es and the command executed successfullly.
I started snooping around for the source of the surplus "as", but have thus far been unsuccessful. This is largely due to my lack of familiarity with the XF code. Any advice on where I should start looking?
Thank-you.