Fix query return type in Widget\TagCloud

This commit is contained in:
Hypolite Petovan 2019-01-21 16:55:35 -05:00
parent 49c9b6f9ff
commit ddad9721c0

View file

@ -89,7 +89,7 @@ class TagCloud
} }
// Fetch tags // Fetch tags
$r = DBA::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term` $tag_stmt = DBA::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term`
LEFT JOIN `item` ON `term`.`oid` = `item`.`id` LEFT JOIN `item` ON `term`.`oid` = `item`.`id`
WHERE `term`.`uid` = ? AND `term`.`type` = ? WHERE `term`.`uid` = ? AND `term`.`type` = ?
AND `term`.`otype` = ? AND `term`.`otype` = ?
@ -100,10 +100,12 @@ class TagCloud
$type, $type,
TERM_OBJ_POST TERM_OBJ_POST
); );
if (!DBA::isResult($r)) { if (!DBA::isResult($tag_stmt)) {
return []; return [];
} }
$r = DBA::toArray($tag_stmt);
return self::tagCalc($r); return self::tagCalc($r);
} }