bugfix: add missing group by parameters

This commit is contained in:
Philipp Holzer 2019-07-12 22:13:28 +02:00
parent c293eadb78
commit 8f0aa0ca5a
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90

View File

@ -4207,7 +4207,7 @@ function api_fr_photos_list($type)
$r = q( $r = q(
"SELECT `resource-id`, MAX(scale) AS `scale`, `album`, `filename`, `type`, MAX(`created`) AS `created`, "SELECT `resource-id`, MAX(scale) AS `scale`, `album`, `filename`, `type`, MAX(`created`) AS `created`,
MAX(`edited`) AS `edited`, MAX(`desc`) AS `desc` FROM `photo` MAX(`edited`) AS `edited`, MAX(`desc`) AS `desc` FROM `photo`
WHERE `uid` = %d AND `album` != 'Contact Photos' GROUP BY `resource-id`", WHERE `uid` = %d AND `album` != 'Contact Photos' GROUP BY `resource-id`, `album`, `filename`, `type`",
intval(local_user()) intval(local_user())
); );
$typetoext = [ $typetoext = [
@ -4888,7 +4888,9 @@ function prepare_photo_data($type, $scale, $photo_id)
"SELECT %s `resource-id`, `created`, `edited`, `title`, `desc`, `album`, `filename`, "SELECT %s `resource-id`, `created`, `edited`, `title`, `desc`, `album`, `filename`,
`type`, `height`, `width`, `datasize`, `profile`, `allow_cid`, `deny_cid`, `allow_gid`, `deny_gid`, `type`, `height`, `width`, `datasize`, `profile`, `allow_cid`, `deny_cid`, `allow_gid`, `deny_gid`,
MIN(`scale`) AS `minscale`, MAX(`scale`) AS `maxscale` MIN(`scale`) AS `minscale`, MAX(`scale`) AS `maxscale`
FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' %s GROUP BY `resource-id`", FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' %s GROUP BY
`resource-id`, `created`, `edited`, `title`, `desc`, `album`, `filename`,
`type`, `height`, `width`, `datasize`, `profile`, `allow_cid`, `deny_cid`, `allow_gid`, `deny_gid`",
$data_sql, $data_sql,
intval(local_user()), intval(local_user()),
DBA::escape($photo_id), DBA::escape($photo_id),