mirror of
https://github.com/friendica/friendica
synced 2025-04-24 07:50:11 +00:00
Fix GROUP BY in acl_selector, api, notifier, photos, messages
https://github.com/friendica/friendica/issues/3322
This commit is contained in:
parent
c3e933642e
commit
74b6d09e89
7 changed files with 14 additions and 12 deletions
|
@ -3064,7 +3064,7 @@ use \Friendica\Core\Config;
|
|||
function api_fr_photos_list($type) {
|
||||
if (api_user()===false) throw new ForbiddenException();
|
||||
$r = q("select `resource-id`, max(scale) as scale, album, filename, type 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())
|
||||
);
|
||||
$typetoext = array(
|
||||
|
@ -3102,8 +3102,10 @@ use \Friendica\Core\Config;
|
|||
$data_sql = ($scale === false ? "" : "data, ");
|
||||
|
||||
$r = q("select %s `resource-id`, `created`, `edited`, `title`, `desc`, `album`, `filename`,
|
||||
`type`, `height`, `width`, `datasize`, `profile`, min(`scale`) as minscale, max(`scale`) as maxscale
|
||||
from photo where `uid` = %d and `resource-id` = '%s' %s group by `resource-id`",
|
||||
`type`, `height`, `width`, `datasize`, `profile`, min(`scale`) as minscale, max(`scale`) as maxscale
|
||||
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`",
|
||||
$data_sql,
|
||||
intval(local_user()),
|
||||
dbesc($_REQUEST['photo_id']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue