Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -937,7 +937,7 @@ |
938 | 938 | $options .= ' OFFSET ' . $requestoptions->offset; |
939 | 939 | } |
940 | 940 | // NOTE: the query needs to do the fitlering of internal properties, else LIMIT is wrong |
941 | | - $res = $db->query('(SELECT smw_id, smw_title, smw_sortkey, COUNT(*) as count FROM ' . |
| 941 | + $res = $db->query('(SELECT smw_id, smw_title, COUNT(*) as count, smw_sortkey FROM ' . |
942 | 942 | $db->tableName('smw_rels2') . ' INNER JOIN ' . $db->tableName('smw_ids') . ' ON p_id=smw_id WHERE smw_iw=' . |
943 | 943 | $db->addQuotes('') . ' OR smw_iw=' . $db->addQuotes(SMW_SQL2_SMWPREDEFIW) . ' GROUP BY smw_id,smw_title,smw_sortkey) UNION ' . |
944 | 944 | '(SELECT smw_id, smw_title, COUNT(*) as count, smw_sortkey FROM ' . |