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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scottrigby’s picture

Title: Allow a variable to override exported field bases (multi-environment Features support) » New variable to override file field URI scheme per environment
FileSize
2.32 KB

Simple 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).

scottrigby’s picture

Status: Active » Needs review
justafish’s picture

Status: Needs review » Fixed

Committed, thanks!

  • justafish committed a544239 on 7.x-1.x authored by scottrigby
    Issue #2422977 by scottrigby: New variable to override file field URI...
scottrigby’s picture

justafish++ :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.