bug 3163: pwg.tags.getImages mysql error if order parameter is provided

git-svn-id: http://piwigo.org/svn/trunk@30359 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2014-11-03 21:07:33 +00:00
parent a8f4ebc06e
commit 2b58912b96
+6 -2
View File
@@ -110,11 +110,16 @@ function ws_tags_getImages($params, &$service)
$where_clauses = implode(' AND ', $where_clauses);
}
$order_by = ws_std_image_sql_order($params, 'i.');
if (!empty($order_by))
{
$order_by = 'ORDER BY '.$order_by;
}
$image_ids = get_image_ids_for_tags(
$tag_ids,
$params['tag_mode_and'] ? 'AND' : 'OR',
$where_clauses,
ws_std_image_sql_order($params)
$order_by
);
$count_set = count($image_ids);
@@ -136,7 +141,6 @@ SELECT image_id, GROUP_CONCAT(tag_id) AS tag_ids
while ($row = pwg_db_fetch_assoc($result))
{
$row['image_id'] = (int)$row['image_id'];
$image_ids[] = $row['image_id'];
$image_tag_map[ $row['image_id'] ] = explode(',', $row['tag_ids']);
}
}