Open tomtoday opened 6 years ago
I think I have a fix for this issue.
The code in question is a action hooked to wp_handle_sideload_prefilter
called filter_sideload_move_temp_file_to_s3
here:
https://github.com/humanmade/S3-Uploads/blob/master/inc/class-s3-uploads.php#L204-L221
If you remove the line where this action is added here: https://github.com/humanmade/S3-Uploads/blob/master/inc/class-s3-uploads.php#L54
Everything works as expected when using S3_UPLOADS_USE_LOCAL
when the action on line 54 is removed
Does that work in production? It will probably mess up the stuff the filter is supposed to fix.
Another solution would be to check if S3_UPLOADS_USE_LOCAL is set and true before adding the action here. https://github.com/humanmade/S3-Uploads/blob/master/inc/class-s3-uploads.php#L54
That way it will use the filter when not using S3_UPLOADS_USE_LOCAL.
Just commenting as i have a issue with this filter aswell :)
@JoelBernerman removing the filter works in production for me. "In production" meaning "actually send files to S3 rather than store them locally using the stream handler that S3_UPLOADS_USE_LOCAL invokes.
The reason that the filter was put in place to workaround a Wordpress core issue. That issue has since been fixed in the core. I am running WP 4.9.x
@tomtoday Hmm that seemed to fix my issue too. Using sideload in ajax calls.
I am using S3-Uploads. It works great for us, much better that other plugins we've used recently. So, to begin, thank you!
I have run into an issue trying to us the
S3_UPLOADS_USE_LOCAL
for offline development. We use using a plugin to import content from GatherContent. It takes advantage of sideloading. When I run the code that sideloads I get the following error:My configuration is as follows:
Normal uploads work as expected under this configuration.