Skip to content
Permalink
Browse files

fixes #777 WS categories getImages, TotalCount for correct pagination…

… builder
  • Loading branch information...
modus75 committed Sep 30, 2017
1 parent a335d70 commit 164b59588c2bf5059a3d77aae2f2e3925cadc4e5
Showing with 4 additions and 2 deletions.
  1. +4 −2 include/ws_functions/pwg.categories.php
@@ -94,7 +94,7 @@ function ws_categories_getImages($params, &$service)
$order_by = empty($order_by) ? $conf['order_by'] : 'ORDER BY '.$order_by;
$query = '
SELECT i.*, GROUP_CONCAT(category_id) AS cat_ids
SELECT SQL_CALC_FOUND_ROWS i.*, GROUP_CONCAT(category_id) AS cat_ids
FROM '. IMAGES_TABLE .' i
INNER JOIN '. IMAGE_CATEGORY_TABLE .' ON i.id=image_id
WHERE '. implode("\n AND ", $where_clauses) .'
@@ -152,12 +152,14 @@ function ws_categories_getImages($params, &$service)
}
}
list($total_images) = pwg_db_fetch_row(pwg_query('SELECT FOUND_ROWS()'));
return array(
'paging' => new PwgNamedStruct(
array(
'page' => $params['page'],
'per_page' => $params['per_page'],
'count' => count($images)
'count' => $total_images
)
),
'images' => new PwgNamedArray(

4 comments on commit 164b595

@plegall

This comment has been minimized.

Copy link
Member

replied Sep 30, 2017

@modus75 do I cherry-pick this commit on branch 2.9 for Piwigo 2.9.2 ?

@modus75

This comment has been minimized.

Copy link
Contributor Author

replied Sep 30, 2017

@plegall

This comment has been minimized.

Copy link
Member

replied Sep 30, 2017

@modus75 ok, done :-)

@erusso7

This comment has been minimized.

Copy link

replied Oct 1, 2017

Thanks!

Please sign in to comment.
You can’t perform that action at this time.