Currently on File field setting forms, we have both 'Allowed media types' and 'Allowed file extensions'. These settings conflict with each other. We discussed changing this into a radios with three different options:
( ) Allowed file types
[ ] Audio
[ ] Image
[ ] Video
( ) Allowed file mime types
[ text field to enter a space-separated list of mime types ]
( ) Allowed file extensions
[ text field to enter a space-separated list of file extensions ]
Selecting either an option in allowed file types or file mime options should automatically pre-fill in the list of allowed file extensions since we need to ensure that the file_extensions instance setting is always available (to allow people to switch back to alternate widgets).
We then need to ensure that we properly validate against these options in the media browser. Also, these options should validate so that *something* underneath the selected radio button is also selected. For example, the user cannot select 'Allow specific file types' and not click one of the file type checkboxes. Or select 'Allow specific file extensions' and not enter any extensions in the text field.
Comment | File | Size | Author |
---|---|---|---|
#21 | fix-inconsistencies-1289900-20.patch | 4.53 KB | aaron |
#13 | better-descriptions-for-field-settings-1289900-13.patch | 3.53 KB | Shawn DeArmond |
#12 | Edit Page A test | Media-1.png | 161.69 KB | Anonymous (not verified) |
#12 | Edit Page A test | Media-2.png | 97.46 KB | Anonymous (not verified) |
#12 | Field info | Media.png | 93.13 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch here is a work in progress... but working on it forced an issue about the utility of mapping broad mime types to file extensions, so this work is somewhat abandoned.
Comment #3
aaron CreditAttribution: aaron commentedthis one grabs the titles & descriptions for allowed extensions & allowed media types. applies to file field & image field as well.
Comment #4
aaron CreditAttribution: aaron commentedoops, empty patch. here we go again!
Comment #5
Dave ReidI'm thinking our description for this field (pre and post-patch) is redundant and really doesn't provide good description aside from the note about the Allowed URI schemes.
Adding a line with trailing spaces here.
I'd probably just change the title to 'Allowed file extensions for uploaded files' and then we probably don't even need to add an additional description.
Comment #6
aaron CreditAttribution: aaron commentedthis also includes an allowed uploaded file exts. field for media fields.
Comment #7
aaron CreditAttribution: aaron commentedComment #8
Dave ReidOn patch review this looks good! Could use someone manually testing it.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm getting these warnings when i try to create a node with a media reference field:
Comment #10
aaron CreditAttribution: aaron commentedme too... :(
Comment #11
aaron CreditAttribution: aaron commentedactually, i get that error even w/o applying this patch.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedThere are some other bugs that are breaking the media reference field. I can select an item from the library for the field, but I can't upload a file with the same extension.
This field is configured to allow all the default types...
Comment #13
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedHere's an updated patch that hides the allowed_types if there are no remote streams.
Haven't addressed #12 yet.
Comment #14
ParisLiakos CreditAttribution: ParisLiakos commentedSubscribe.Applied patch in #6 ,cleared cache twice,same error as #12
Comment #15
Dave ReidOH! We need to add the default variables to media_field_info() under 'instance settings' and not in media_field_widget_info().
Comment #16
Shawn DeArmond CreditAttribution: Shawn DeArmond commented#12 is happening on 7.x-2.x, even when I don't apply this patch. Should that be its own issue?
Comment #17
ParisLiakos CreditAttribution: ParisLiakos commentedIt was: #1290428: Cannot upload media file
I am coming from there,it got closed as duplicated in favor of this
Comment #18
Shawn DeArmond CreditAttribution: Shawn DeArmond commented@rootatwc, if it's a totally separate issue, which I think it is, then it should be its own issue, and we should review this one separately.
Comment #19
Dave ReidOk yeah I am fixing the PHP notices now. I found it was a different issue.
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commented@#18 : done
Comment #21
aaron CreditAttribution: aaron commentedthis fixes #12 and #15. builds on #13.
Comment #22
ParisLiakos CreditAttribution: ParisLiakos commentedWorks:)
so #1290428: Cannot upload media file IS duplicate of this:)
Comment #23
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedWorks for 2.x. Haven't tested 1.x.
Comment #24
aaron CreditAttribution: aaron commentedwoops, doesn't address #12 -- it's the earlier #9 it fixes. sorry
Comment #25
aaron CreditAttribution: aaron commentedComment #26
aaron CreditAttribution: aaron commentedcommitted! thanks!
Comment #27
Dave ReidFollowup: #1290500: Unify upload validation for both upload and the web tabs.
Comment #28
aaron CreditAttribution: aaron commentedneed to do a quick check vs. v1
Comment #29
aaron CreditAttribution: aaron commentedworks there as well. committed.
Comment #30.0
(not verified) CreditAttribution: commentedupdating