I needed the media file info in the mediaStyleSelector form. Heres a tiny patch that passes it though.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emattias’s picture

Status: Active » Needs review
mglaman’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
658 bytes

Re-roll to latest 7.x-2.x

mglaman’s picture

Status: Reviewed & tested by the community » Needs review

Er.. didn't mean to RTBC. This is good hack, however Media needs better internal support for passing media information to the form.

pontus_nilsson’s picture

Re-roll against latest 7.x-2.x.

Chris Matthews’s picture

Status: Needs review » Closed (won't fix)

The 4 year old patch in #4 to media.popups.js does not apply to the latest media 7.x-2.x-dev, but feel free to submit a re-rolled patch and a media maintainer will consider re-opening if you need this and want it reviewed.

Checking patch js/media.popups.js...
error: while searching for:
    defaults.src.unshift(src);
    defaults.src = src.replace('-media_id-', mediaFile.fid) + '&fields=' + encodeURIComponent(JSON.stringify(mediaFile.fields));
  }
  options = $.extend({}, defaults, options);
  // Create it as a modal window.
  var mediaIframe = Drupal.media.popups.getPopupIframe(options.src, 'mediaStyleSelector');
  // Attach the onLoad event

error: patch failed: js/media.popups.js:154
error: js/media.popups.js: patch does not apply
mglaman’s picture

Status: Closed (won't fix) » Needs work

If a patch no longer applies it Needs Work.

Please review the issue statuses and issue handbook https://www.drupal.org/node/317

Chris Matthews’s picture

Hi Matt, I'm familiar with the issue statues. joseph.olstad asked me to mark these broken patches as closed outdated. Are you still interested in this patch?

mglaman’s picture

I am not on the project which requires it anymore. But it is definitely not outdated as a maintainer did not give reasoning why it is a won't fix or not. The case was made that the media file needs to be accessible through extended scripts. It's not outdated purely because the patch doesn't apply (ie: it's not a bug which was fixed elsewhere, unless another issue added this functionality.)

joseph.olstad’s picture

Here's a re-rolled patch.

I'm not sure why this should be included in a release or not.

A screenshot before patch and after patch is worth 1000 words, or detailed explanation of what this does.

See patch

joseph.olstad’s picture

Status: Needs work » Needs review