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.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 2511734.5-unlimited-cardinality.patch | 1.32 KB | deviantintegral |
#1 | file-unlimited-2511734.patch | 678 bytes | larowlan |
Comments
Comment #1
larowlanComment #2
nattsThanks - the patch (#1) fixes the problem for us.
Comment #3
nattsComment #4
jordan8037310 CreditAttribution: jordan8037310 at Facet Interactive commentedThis 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.
Comment #5
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedI 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.
Comment #6
deviantintegral CreditAttribution: deviantintegral at Lullabot commented