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
The scheme step (file_entity_add_upload_step_scheme) is not skipped on the multi step file upload form when there is a single scheme available.
Proposed resolution
The fix is the same as #2411391: File destination not showing. The array_intersect_key() fails, returning nothing in file_entity_add_upload_submit().
Remaining tasks
Fix
User interface changes
Skipped step for a single scheme functionality will return.
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#1 | 2532104.patch | 567 bytes | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedComment #2
Dave ReidWhat version of the media module were you using? It might be possible this was resolved with #2363897: Unable to select required field destination on media upload?
Comment #3
Dave ReidComment #4
damiankloip CreditAttribution: damiankloip commentedLooks like the same problem exists in the 7.x-2.x branch. file_entity_add_upload_step_scheme() uses array_flip:
Where as file_entity_add_upload_submit doesn't:
The code paths are the same, using the same options from $form['#options']. This always leads to empty schemes, so it will never == 1. When the actual scheme step is displayed it is fine, as that is fixed per the first code snippet above.
Comment #5
Dave ReidI'm unable to replicate any bugs with just having one scheme available (public only). I will need some better steps to reproduce the issue.
Comment #6
damiankloip CreditAttribution: damiankloip commentedOh, I think I see what was happening. file_entity alone was fine as file_entity_add_upload() has no options on the file upload page. With media module, however, file_entity_add_upload() is used on the media browser. I think that is where the wrong options were passed. With the latest media module this work fine though.