The media element and field widget differ from their managed_file equivalents in a number of areas, including theme wrappers, support for certain properties (display) and multiple value behaviour (standard vs custom + AJAX).

Bringing the media element and field widget inline with their managed_file equivalents should improve UX and solve a number of long-standing issues.

The attached patch brings the media element and field widget inline with managed_file and addresses the following issues:

@todo

    Fix some bugs with core AJAX functionality.
  • Restore edit file link (ctools modal buttons aren't currently compatible with AJAX).
  • Potentially include more integration when used with image fields.
  • Potentially add support for progress indicator.

Comments

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new52.17 KB

A patch to address the issues in the OP.

devin carlson’s picture

An updated patch to fix the issues outlined in the op.

The remaining task is to fix the ctools modal for editing files, which will be addressed in a major followup as it currently causes styling issues which are made more pronounced by the addition of AJAX.

devin carlson’s picture

Status: Needs review » Fixed

Tested #2 with a variety of both fresh and existing Drupal sites which were using different admin/non-admin themes and didn't run into any issues. Also verified that WYSIWYG functionality still works properly. Writing follow-up issues.

Committed #2 to Media 7.x-2.x.

peacog’s picture

I have the latest dev of Media and File Entity, and I'm not seeing an Edit button when I edit a node that has a media image field. I just get a Remove button. I see that media_element_process() doesn't create an Edit button anymore - is there some configuration I have to set to allow editing of a media field?

devin carlson’s picture

@Peacog the button was removed due to some outstanding issues but I'm currently working with a ctools maintainer in order to fix the regression (hopefully in the next couple of days). I opened #2192981: Restore media field widget edit button so that the issue can be tracked publically.

peacog’s picture

Excellent! Thank you.

Status: Fixed » Closed (fixed)

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

ParisLiakos’s picture

So one more patch with massive changes, which was never reviewed from anyone before being committed

  1. The browse/attach workflow is very confusing. The first time i saw it, i couldnt decide which one to use and which was the difference between them..The managed file button has an upload button because it makes sense..it doesnt make sense here because the file is already uploaded
  2. We introduced a critical regression in favor of a normal task..The ctools problem which makes the edit button problematic should be fixed before this issue. ie this should be postponed

i would be much in favor of reverting this patch

mehotkhan’s picture

hi , i come from https://drupal.org/node/2216273
any body know how i can fix this problem ?

sheldonkreger’s picture

Adding related issue. This commit breaks media_multiselect sandbox.

sheldonkreger’s picture

Sorry, Media Multiselect issue is already listed as a child issue :-)