specials: Fix "include templates" query builder for Special:Export
The 'templatelinks' table was added twice to the query due to
queryInfo() and explicit join(). Also unnecessary fields are added by
queryInfo().
Split queryInfo() call into tables() and joinConds() and remove the
templatelinks while adding the tables. Build the whole query builder
before calling getLinks() to make it easier to see the whole query.
The query is:
SELECT lt_namespace AS namespace
, lt_title AS `title` FROM `page` JOIN `templatelinks` ON ((page_id=tl_from)) JOIN `linktarget` ON ((tl_target_id=lt_id))
WHERE page_namespace = 0
AND page_title = '...'
Bug: T364554
Follow-Up: Ie0d54b6abbd5abd7eecff59bde62caacb1f65aa6
Change-Id: I17c4c0da1d373add1369417e8c64c02253b82b2b