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.

Comments

redndahead’s picture

Status: Active » Needs review
StatusFileSize
new7.86 KB

Here is the patch.

redndahead’s picture

StatusFileSize
new7.96 KB

Missing a couple of lines.

redndahead’s picture

StatusFileSize
new7.98 KB

Here is an updated patch against dev.

aaron’s picture

Status: Needs review » Reviewed & tested by the community

Works as advertised.

ParisLiakos’s picture

+++ b/modules/media_internet/media_internet.pages.inc
@@ -10,7 +10,18 @@
-function media_internet_add($form, &$form_state = array(), $types = NULL) {
+function media_internet_add($form, &$form_state = array(), $options = array()) {

@@ -56,130 +67,123 @@ function media_internet_add($form, &$form_state = array(), $types = NULL) {
-  if ($types) {
-    $form['#validators']['media_file_validate_types'] = array($types);
+  if ($options) {

i 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

aaron’s picture

Issue tags: +Needs tests

I 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.

aaron’s picture

3: 1931336-d7-4.patch queued for re-testing.

aaron’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

The patch no longer applies.

redndahead’s picture

StatusFileSize
new7.95 KB

Here is a re-roll.

redndahead’s picture

Status: Needs work » Needs review

The last submitted patch, 3: 1931336-d7-4.patch, failed testing.

socialnicheguru’s picture

this seems to be working for me

David_Rothstein’s picture

Category: Feature request » Bug report
StatusFileSize
new8.14 KB
new887 bytes

This 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).

David_Rothstein’s picture

Title: Have media internet use a wizard like the file_entity upload does » Media Internet should use a wizard like the file_entity upload does, to allow fields and the filename to be edited
David_Rothstein’s picture

StatusFileSize
new9.57 KB
new2.82 KB

Actually, 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.

devin carlson’s picture

While 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.

longlivelance’s picture

Status: Needs review » Reviewed & tested by the community

Tested locally. 1931336-media-internet-upload-wizard-16.patch fixes issue.

devin carlson’s picture

Status: Reviewed & tested by the community » Fixed

Retested #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.

  • Commit d246c78 on 7.x-2.x by Devin Carlson:
    Issue #1931336 by redndahead, David_Rothstein, Devin Carlson: Reused the...
aspilicious’s picture

Status: Fixed » Active

Reopening this one, when I pull latest dev, the web source handling is broken. I cleared caches several times.

devin carlson’s picture

Status: Active » Postponed (maintainer needs more info)

@aspilicious Did you also pull the latest version of File Entity?

devin carlson’s picture

Status: Postponed (maintainer needs more info) » Fixed

I'm not able to duplicate any issues with the latest commit hash of Media and File Entity.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.