Problem/Motivation

To reproduce:

  • Add a new file file with unlimited values
  • Upload one file - works
  • Upload a second file - does not work - 403 error

Reason:
Core does not call amazons3_field_widget_form_alter() for the new value widget on cardinality unlimited field - so the uris end up being s3://upload_location instead of s3://{bucket}/upload_location.

Proposed resolution

Ignore the delta context and just loop over element children

Remaining tasks

Review
Can we write tests for this?

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Active » Needs review
FileSize
678 bytes
natts’s picture

Thanks - the patch (#1) fixes the problem for us.

natts’s picture

Status: Needs review » Reviewed & tested by the community
jordan8037310’s picture

Status: Reviewed & tested by the community » Needs work

This worked for my files when the widget was set as File field, but this did not work for uploading through the Media widget.

Also, I was uploading across two separate sets of fields, but I don't think that should have had an impact.

deviantintegral’s picture

Status: Needs work » Needs review
FileSize
1.32 KB

I think we actually need both code paths - the original code is what's used for media fields.

I don't see a good way to test this without adding simpletest coverage or a pretty serious refactor of the forms code. I'm OK committing this without a test.

deviantintegral’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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