From 4b4f24057b2eb45dcc8fabe6c9c818ca420f9974 Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 24 Feb 2022 00:54:16 -0800 Subject: [PATCH] Regression: Cover photos being stored in cloud root instead of "Cover Photos" folder. Ditto for Profile Photos. --- include/attach.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/attach.php b/include/attach.php index 0d4b90a13..760dc424d 100644 --- a/include/attach.php +++ b/include/attach.php @@ -687,7 +687,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) $pathname = ''; - + // If we were called from the Photos module there is a slightly different mechanism // for setting the parent path than if we were called from the Files (cloud) module. @@ -707,6 +707,11 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) $pathname = filepath_macro($album); } } + elseif ($album && !$newalbum) { + // We can land here from the profile_photo and cover_photo modules. + // Just use the album provided. + $pathname = filepath_macro($album); + } if (! $pathname) { $pathname = filepath_macro($upload_path);