From: Hypolite Petovan Date: Thu, 25 Jun 2020 12:05:09 +0000 (-0400) Subject: Replace array_unique with GROUP BY clause in api_fr_photoalbum_delete() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b6c7f247ccc8b0fc17bd141558ae58daa19565f8;p=friendica.git Replace array_unique with GROUP BY clause in api_fr_photoalbum_delete() --- diff --git a/include/api.php b/include/api.php index ace168e9e3..7a6769ebc1 100644 --- a/include/api.php +++ b/include/api.php @@ -4079,12 +4079,12 @@ function api_fr_photoalbum_delete($type) } // check if album is existing - $photos = DBA::selectToArray('photo', ['resource-id'], ['uid' => api_user(), 'album' => $album]); + $photos = DBA::selectToArray('photo', ['resource-id'], ['uid' => api_user(), 'album' => $album], ['group_by' => ['resource-id']]); if (!DBA::isResult($photos)) { throw new BadRequestException("album not available"); } - $resourceIds = array_unique(array_column($photos, 'resource-id')); + $resourceIds = array_column($photos, 'resource-id'); // function for setting the items to "deleted = 1" which ensures that comments, likes etc. are not shown anymore // to the user and the contacts of the users (drop_items() performs the federation of the deletion to other networks