I've been working with both Media module and Manual Crop recently, and noticed that the development version of Manual Crop no longer works with Media, when applied to a field that uses the Media Browser as its widget. This is because it uses the following call in Form API to try and set a custom class on the wrapper surrounding the form field:
$element['#attributes']['class'][] = 'manualcrop-file-' . $fid . '-holder';
This custom class is then picked up by Manual Crop as a way to scope its UI invocation.
However, since the theme function for this field is theme_media_widget, and the classes for this widget are hardcoded, this class can't be applied and the Manual Crop UI no longer works.
This patch allows arbitrary attributes to be applied to elements styled with theme_media_widget. It might come in handy for issues like #2408115: Improve Upload widget accessibility as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | media-theme_media_widget-flexible-7.patch | 1011 bytes | geoffreyr |
Comments
Comment #1
geoffreyr commentedComment #2
geoffreyr commentedRerolled against dev.
Comment #4
joseph.olstaderror: patch failed: includes/media.fields.inc:427patch does not apply
Comment #5
geoffreyr commentedRerolled again against latest dev - let's try this again.
Comment #6
geoffreyr commentedHmm... I know it's just passed the tests, but by the looks of it the ID being passed in is not unique, resulting in the JS not working properly. Had this problem on my local dev environment. Maybe if I append '--widget' to it or something, it will make it sufficiently unique.
Comment #7
joseph.olstad@geoffreyr , ok please make that change to the ID and we'll review it :)
Comment #8
geoffreyr commentedOK, reuploaded the patch with the ID change. This should ensure that there aren't any clashes with the upload button.
Comment #9
joseph.olstadComment #11
joseph.olstadlooks good thanks, its committed to the 7.x-2.x branch