Currently the file module looks at all stream wrappers and presents everyone except 'temporary' as a possible file upload destination.
This seems terribly foolish to hard-code this way.
Wee should expand the data returned by hook_stream_wrappers() to include those as flags.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 685074-wrapper-types-11.patch | 6.75 KB | pwolanin |
| #9 | 685074-wrapper-types-8.patch | 6.04 KB | pwolanin |
| #3 | 685074-rough-2.patch | 3.86 KB | pwolanin |
| #2 | 685074-rough-1.patch | 3.89 KB | pwolanin |
Comments
Comment #1
aaron commentedthis is an excellent idea.
Comment #2
pwolanin commentedHere's a quick pass at what a change could look like.
Comment #3
pwolanin commentedmissed git flag
Comment #4
aaron commentedthis is looking very usable atm -- in contrib, this will make some things a lot easier, such as remote read-only streams. i haven't tested yet, but will look at it in more detail tomorrow. great work, @pwolanin!
Comment #6
pwolanin commentedStream wrappers won't be usable without some version of this fix.
Comment #7
dries commentedThis makes sense.
Wrong constant? Haz typo?
I don't understand what _VISIBLE stands for. Visible to whom?
Comment #8
pwolanin commentedCertainly typo in the code comment.
VISIBLE here means visible in the UI at a source/destination - e.g. the temporary:// is not visible. we could flip the logic I guess to HIDDEN, but that requires an additional check I think.
I was thinking in analogy to menu callbacks which don't get the MENU_VISIBLE_IN_TREE bit flag.
Comment #9
pwolanin commentedadded code comments and fixed systedm.admin.inc.
Default filter is now STREAM_WRAPPERS_ALL, so hopefully tests will pass.
Comment #10
aaron commentedOK, this patch works perfectly.
Without it, if you install Media: YouTube or Media: Flickr, then both those streams incorrectly show up at admin/config/media/file-system.
After patching, and adding
to hook_stream_wrappers(), the stream wrappers no longer show up.
This is RTBC as soon as the test passes.
Comment #11
pwolanin commentedoops - missed adding the filx to image field as well as file field.
Comment #12
dries commentedThanks for adding documentation. Committed to CVS HEAD. Thanks! I'm marking this 'needs work' because it could use some extra tests.
Comment #13
Tor Arne Thune commentedComment #32
kim.pepperThis was committed but never closed.
Comment #33
kim.pepperIf there are tests required still we should open a new issue.
Comment #34
quietone commented@kim.pepper, thanks for closing this issue.
I am updating the meta data and credit to the time of the commit.