It looks like some links were lost when creating the ticket. The site in question is https://natm.commons.gc.cuny.edu/ and it appears that an affected URL is https://natm.commons.gc.cuny.edu/your-gallery/
After a bit of investigation, it looks like there's an incompatibility between the way the acf-views plugin works and the way that s3-uploads filters upload paths. The plugin initializes itself immediately when the plugin file is loaded during the WP bootstrap:
https://github.com/cuny-academic-commons/cac/blob/70f7bb4a79d66ba7c9b9b727e96176cccf80b75f/wp-content/plugins/acf-views/acf-views.php#L82
https://github.com/cuny-academic-commons/cac/blob/70f7bb4a79d66ba7c9b9b727e96176cccf80b75f/wp-content/plugins/acf-views/acf-views.php#L621
At that time, the plugin determines its "uploads_folder" using wp_upload_dir()
https://github.com/cuny-academic-commons/cac/blob/70f7bb4a79d66ba7c9b9b727e96176cccf80b75f/wp-content/plugins/acf-views/acf-views.php#L151
The problem is that, at this point, the s3-uploads isn't yet initialized. Like a good plugin, it waits until plugins_loaded
: https://github.com/cuny-academic-commons/cac/blob/70f7bb4a79d66ba7c9b9b727e96176cccf80b75f/wp-content/plugins/s3-uploads/s3-uploads.php#L13
As a result, acf-views believes that its upload path should be in the filesystem. But by the time it actually tries to write to the filesystem, s3-uploads has loaded its stream wrapper, which points these file operations to S3. This means that checks like is_writable( $uploads_folder )
fail.
If I replace the plugin's call to init() with this, it works:
add_action(
'plugins_loaded',
function() use ( $acf_views ) {
$acf_views->init();
}
);
I tried a half-dozen workarounds (allowing filesystem writes for this plugin, reinitializing the plugin with reflection classes, etc) but nothing worked. I went with the unpleasant approach of preventing the plugin from being loaded during the WP bootstrap, and delaying it to plugins_loaded:1 https://github.com/cuny-academic-commons/cac/commit/04b66f9688460e30e4a3253ce85a0266660fa592
Ray and Jeremy, I share this approach here in case you need it in the future, or in case you have a better idea or a warning about how this might break things.
Marilyn, it appears that the pages are working as expected, but I'm not certain how all of the sites are supposed to work, so perhaps you could check back with the reporter.