From 871f798cc9665b1a94e42a647e738353b3fee050 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 23 Mar 2023 01:00:58 -0600 Subject: [PATCH] Update ap helpers, fix album order bug by setting media order --- app/Util/ActivityPub/Helpers.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 41fb63b86..66e75c8fa 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -665,7 +665,7 @@ class Helpers { $storagePath = MediaPathService::get($user, 2); $allowed = explode(',', config_cache('pixelfed.media_types')); - foreach($attachments as $media) { + foreach($attachments as $key => $media) { $type = $media['mediaType']; $url = $media['url']; $valid = self::validateUrl($url); @@ -685,6 +685,7 @@ class Helpers { $media->media_path = $url; $media->remote_url = $url; $media->caption = $caption; + $media->order = $key + 1; if($license) { $media->license = $license; }