Since there isn't a wizard for media_internet there is no way for someone to manage the fields attached to a file type when they add internet media. We should replicate how things are done for the file_entity upload field.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 1931336-media-internet-upload-wizard-16.patch | 13.54 KB | devin carlson |
| #15 | interdiff-13-15.txt | 2.82 KB | David_Rothstein |
| #15 | 1931336-media-internet-fields-d7-15.patch | 9.57 KB | David_Rothstein |
| #13 | interdiff-5-13.txt | 887 bytes | David_Rothstein |
| #13 | 1931336-media-internet-fields-d7-13.patch | 8.14 KB | David_Rothstein |
Comments
Comment #1
redndahead commentedHere is the patch.
Comment #2
redndahead commentedMissing a couple of lines.
Comment #3
redndahead commentedHere is an updated patch against dev.
Comment #4
aaron commentedWorks as advertised.
Comment #5
ParisLiakos commentedi think $types is a better variable name here since it just ends up in 'media_file_validate_types'?
also how hard would it be to write a test that validates the correct behavior here? i see that we have zero tests with media_internet module, so that would be sweet, but not an actual blocker
Comment #6
aaron commentedI believe the use of $options is to allow for future expansion of the parameters. I agree that testing would be valuable here, but I don't want that to hold things up. I will add a tag so that we can add that later if we want.
Comment #7
aaron commented3: 1931336-d7-4.patch queued for re-testing.
Comment #8
aaron commentedThe patch no longer applies.
Comment #9
redndahead commentedHere is a re-roll.
Comment #10
redndahead commentedComment #12
socialnicheguru commentedthis seems to be working for me
Comment #13
David_Rothstein commentedThis functionality was working in earlier versions of 7.x-2.x, so it looks like a bug/regression to me. There's now no longer any way to affect the properties of these files as you're adding them to the site via the media browser (you'd need to go back and edit them later).
Here's a reroll that also allows the file name to be edited on this form (just like the File Entity form does).
Also note that the patches here really require #1802026: Ajax callbacks in the media overlay cause the active tab to switch tab unexpectedly to avoid a major usability problem (since the "Web" tab, unlike "Upload", is not the default tab in the media browser).
Comment #14
David_Rothstein commentedComment #15
David_Rothstein commentedActually, why are these patches removing media_internet_add_validate()? This means than an invalid embed code leads to an uncaught exception rather than a friendly error message.
This patch adds it back, with code to make sure it only runs after the first step of the wizard.
Comment #16
devin carlson commentedWhile ideally I think that Media Internet should either enhance the default media element or add an element of its own, for now it's probably easiest to reuse the existing file upload wizard and simply alter the first step to replace the upload form with Media Internet's textfield.
Comment #17
longlivelance commentedTested locally. 1931336-media-internet-upload-wizard-16.patch fixes issue.
Comment #18
devin carlson commentedRetested #16 and verified that adding internet media worked as expected.
There are a variety of additional improvements that could be done (tests, dedicated media internet widget, etc) but I'll leave those to followup issues.
Comment #20
aspilicious commentedReopening this one, when I pull latest dev, the web source handling is broken. I cleared caches several times.
Comment #21
devin carlson commented@aspilicious Did you also pull the latest version of File Entity?
Comment #22
devin carlson commentedI'm not able to duplicate any issues with the latest commit hash of Media and File Entity.