Commit bc1073ab authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix mysql syntax in tag searches


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 3e94c902
......@@ -2049,7 +2049,7 @@ function get_my_tags($limit=null, $cloud=true, $sort='freq') {
}
$tagrecords = get_records_sql_array("
SELECT
t.tag, COUNT(t.tag)
t.tag, COUNT(t.tag) AS count
FROM (
(SELECT at.tag, a.id, 'artefact' AS type
FROM {artefact_tag} at JOIN {artefact} a ON a.id = at.artefact
......
......@@ -885,7 +885,7 @@ class PluginSearchInternal extends PluginSearch {
if ($count = count_records_sql('SELECT COUNT(*) ' . $from, $values, $offset, $limit)) {
$result->count = $count;
$sort = $sort == 'date' ? 'ctime DESC' : 'title ASC';
if ($data = get_records_sql_assoc("SELECT type || ':' || id AS tid, * " . $from . ' ORDER BY ' . $sort, $values, $offset, $limit)) {
if ($data = get_records_sql_assoc("SELECT type || ':' || id AS tid, p.* " . $from . ' ORDER BY ' . $sort, $values, $offset, $limit)) {
if ($returntags) {
$ids = array('view' => array(), 'artefact' => array());
foreach ($data as &$d) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment