Problem/Motivation
When using Features (or hook_field_default_field_bases()
directly) to export file field definitions, the Upload destination is included. This can already be handled in a custom module by implementing hook_field_default_field_bases_alter()
, and checking $conf
(set in env-specific settings files, etc). But it would be nice to include support directly in amazons3.module.
Proposed resolution
Implement hook_field_default_field_bases_alter()
, and check for a namespaced variable amazons3_file_uri_scheme_override
. This variable can be added to environment-specific sites/*/settings*.php
files to allow certain environments to upload to S3 while other environments upload to whatever the defined/exported (public or private) URI scheme is.
User interface changes
The only change in the UI would be that the field settings reflect the URI scheme defined either by the exported field bases or the variable (on environments where that's present).
API changes
No API changes, but the patch documents usage of the variable.
Comment | File | Size | Author |
---|---|---|---|
#1 | amazons3-file_uri_scheme_override-2422977-1.patch | 2.32 KB | scottrigby |
Comments
Comment #1
scottrigbySimple patch attached. Note the variable is not deleted by
amazons3_uninstall()
because it's only valid use case is being defined in$conf
(otherwise just change the field setting).Comment #2
scottrigbyComment #3
justafishCommitted, thanks!
Comment #5
scottrigbyjustafish++ :)