Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using Features, exported field definitions capture the URI scheme. The 2.x branch has a nifty fix for this, leveraging hook_field_default_field_bases_alter()
. I'll post a patch shortly that adapts this for s3fs.
Comment | File | Size | Author |
---|---|---|---|
#1 | s3fs-allow_uri_scheme_overrides-2495559-1.patch | 979 bytes | ergonlogic |
Comments
Comment #1
ergonlogicAnd here's the patch.
Comment #2
coredumperror CreditAttribution: coredumperror commentedCould you go into more detail on why this is helpful? I'm not really grasping what this patch actually allows one to do.
Comment #3
ergonlogicWhen you export field definitions to Features, it captures the URI, most likely public://. This hook overrides these field base definitions to allow transparent use of s3:// instead, without having to update all your Features. It also has the nice result of making any images bundled with Features via uuid_features upload to S3 when reverting the feature.
To activate this effect, it's sufficient to drop a single line in your settings.php:
This allows for local development using the public:// scheme, and production deployment to s3://.
Comment #4
coredumperror CreditAttribution: coredumperror commentedAh, OK. Sounds useful. I'll go ahead and add your patch.