Page MenuHomePhabricator

Query::getSubcategories() function returns bad query error
Closed, DeclinedPublic

Description

Using a DPL query using the "*" on category syntax return a query error and fails.

From the documentation

{{#dpl:
|category=+Africa|Europe
|category=**Politics and conflicts
|ordermethod=category,sortkey
|headingmode=ordered
}}

The Category = **<category> ends up returning the following error

Error Code: 1054. Unknown column 'categorylinks.cl_to' in 'where clause'

The query in question is:

SELECT DISTINCT page_title FROM `mw_page` INNER JOIN `mw_categorylinks`
ON ((page.page_id = categorylinks.cl_from)) 
WHERE page_namespace = '14' AND categorylinks.cl_to = 'Ship';

Note: Our wiki has the tables prefixed with "mw_" . They query definition in the Query::getSubcategories(Query.php line 539) needs to be calling $DB->tableName() around each of the tables referenced in the where and join clauses.

"Query.php" line 593