diff options
author | rvelices <rv-github@modusoptimus.com> | 2014-11-03 21:07:33 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2014-11-03 21:07:33 +0000 |
commit | 2b58912b96e74e36d3bc2cd5d57d3e5c36c461f3 (patch) | |
tree | 37af196c6dffb3c32f0f31cc49a5e4b134753c7f | |
parent | a8f4ebc06e24c854e918a397e7031a8f750bd331 (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | include/ws_functions/pwg.tags.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ws_functions/pwg.tags.php b/include/ws_functions/pwg.tags.php index 09ce21bd0..c4ce2b7fc 100644 --- a/include/ws_functions/pwg.tags.php +++ b/include/ws_functions/pwg.tags.php @@ -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']); } } |