Merge pull request #5163 from annando/bugfix-user-item

Fix SQL error in tagcloud
This commit is contained in:
Hypolite Petovan 2018-06-02 13:49:58 -04:00 committed by GitHub
commit 0eafea86ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,11 +91,13 @@ class TagCloud
// Fetch tags
$r = dba::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term`
LEFT JOIN `item` ON `term`.`oid` = `item`.`id`
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = ?
WHERE `term`.`uid` = ? AND `term`.`type` = ?
AND `term`.`otype` = ?
AND $item_condition $sql_options
GROUP BY `term` ORDER BY `total` DESC $limit",
$uid,
$uid,
$type,
TERM_OBJ_POST
);