From 5b80a1fcaa04e96992cc54c27e8437a88df591f1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 20 Apr 2017 21:23:45 +0200 Subject: [PATCH] mod photos compatibility only_full_group_by Related to https://github.com/friendica/friendica/pull/3323 --- mod/photos.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 8e47829774..a22f919c89 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1241,7 +1241,8 @@ function photos_content(App $a) { } $r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, - ANY_VALUE(`type`) AS `type`, max(`scale`) AS `scale`, ANY_VALUE(`desc`) as `desc` + ANY_VALUE(`type`) AS `type`, max(`scale`) AS `scale`, ANY_VALUE(`desc`) as `desc`, + ANY_VALUE(`created`) as `created` FROM `photo` WHERE `uid` = %d AND `album` = '%s' AND `scale` <= 4 $sql_extra GROUP BY `resource-id` ORDER BY `created` $order LIMIT %d , %d", intval($owner_uid), @@ -1842,7 +1843,9 @@ function photos_content(App $a) { $a->set_pager_itemspage(20); } - $r = qu("SELECT `resource-id`, `id`, `filename`, type, `album`, max(`scale`) AS `scale` FROM `photo` + $r = qu("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, + ANY_VALUE(`type`) AS `type`, ANY_VALUE(`album`) AS `album`, max(`scale`) AS `scale`, + ANY_VALUE(`created`) AS `created` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", intval($a->data['user']['uid']), -- 2.39.5