Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
After upgrading a site to latest 7.x core and all the modules when uploading an image using the media browser widget the second page lists no destinations.
Proposed resolution
Issue appears to be in file_entity.pages.inc with the removing any schemes not in the instance settings. It is using array_intersect_key() but $options['schemes'] are numerical indexes and file_get_stream_wrappers() is associative:
array (size=3)
'rcf' => string 'Rackspace Cloud Files.' (length=22)
'public' => string 'Public local files served by the webserver.' (length=43)
'private' => string 'Private local files served by Drupal.' (length=37)
'schemes' =>
array (size=2)
0 => string 'public' (length=6)
1 => string 'private' (length=7)
I've attached a patch file that I believe should resolve this issue but would prefer review.
Comment | File | Size | Author |
---|---|---|---|
#3 | file-destination-not-showing-2411391.patch | 559 bytes | Say_Ten |
file_entity.pages_.inc_.patch | 466 bytes | Say_Ten | |
Comments
Comment #1
gmclelland CreditAttribution: gmclelland commentedSetting the correct status to NR.
Comment #3
Say_Ten CreditAttribution: Say_Ten commentedUpdated patch file that should apply correctly, sorry new to creation of git patches for Drupal.
Comment #4
Say_Ten CreditAttribution: Say_Ten commentedComment #5
jonathan_hunt CreditAttribution: jonathan_hunt commentedWorks for me, thanks.
Comment #6
mariancalinro CreditAttribution: mariancalinro commentedWorks for me too.
However, on first glance it's not obvious why an array_flip is needed, maybe a comment describing the issue would help for others going over the code.
I'm going to change this in RTBC, because i suspect a lot of people will get bitten by this, and it's not so strait forward to identify what's going on. If the maintainer thinks it needs more work, than he can change it back to needs work.
Comment #7
aaron CreditAttribution: aaron commentedComment #10
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/file_entity.git/commit/542c154.