Clicking on the "upload media" link has resulted in a blank form since #1552988: Move file/add from media to file was committed.

I believe a number of paths and function names will have to be updated to get the upload media functionality working again. These changes are only required when using Media 1.x, so #1394148: Create a 7.x-2.x branch of Workbench Media to integrate with Media 7.x-2.x blocks this issue.

Comments

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new1.65 KB

A patch to accommodate the changes made to file/add in Media and File entity.

I couldn't get the upload media form to work by simply changing all of the paths and function names from the old Media values to the new File entity values, so I replaced the Workbench Media form callback for adding media wrapper function with a simple hook_form_alter(). An existing comments suggests avoiding a form_alter but I can't see the issue with doing so.

devin carlson’s picture

Status: Needs review » Needs work

This will end up redirecting the user to the Workbench Media page in all cases. I think this my original issue with not being able to get the module to work after changing all of the file paths and function names may be the result of #1620030: managed_file file extension validation issues.

I'll do some further testing.

devin carlson’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB

A patch to only change the values which were affected by the file/add move.

devin carlson’s picture

As I suspected, the patch in #3 works but uploading a file is failing with a validation error due to #1620030: managed_file file extension validation issues.

bobodrone’s picture

@Devin: How did you get it to work?

* I'm running Drupal 7.14
* I'm running file_entity 2.x-dev and media 2.x-dev.
* I've applied your patch here for workbench_media
* I've applied the (a D7 version) of the patch found here: http://drupal.org/node/1620030 (managed_file file extension validation issues)

But I still get the weird message: "Upload a new file field is required." when Im trying to upload an image trough wb media.
Any idea?

/ bobodrone (NodeOne, Sweden)

devin carlson’s picture

@bobodrone, I couldn't get this working using either of the previous patches.

Since I haven't been able to track down the cause of the issue with #3, I've switched to using a modified version of #1 which only handles redirection if the user arrives at the file/add page via the media/add page.

dave reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
StatusFileSize
new2.34 KB

This is actually the easiest change to make and simplifies the code a lot.

From http://drupal.org/node/1294132#comment-6438240:

Actually it's much easier to just add a 'query' => drupal_get_destination() to the link that is output via Workbench Media since File entity respects destination if you provide it one. Plus this code is missing access checks to ensure that the user can actually edit the file, which is automatically provided by file entity if we use it.

dave reid’s picture

Status: Needs review » Fixed

Tested and confirmed #7 for Media 2.x works as expected. Committed to 7.x-2.x.
http://drupalcode.org/project/workbench_media.git/commit/4537f22

Status: Fixed » Closed (fixed)

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