Using the latest dev release of today I found the "Crop media" button was not showing. Turns out it is there but hidden by CSS because it is failing to correctly set an inline style of display:inline-block which would override the media.css rule ".media-widget a.button + a.button".
This is what I get in Chrome's inspector:
<a href="http://localhost/country-gardener/main/imagecrop/overview/1/thumbnail/node/business/field_logo" class="imagecrop-button button imagecrop-processed" title="Crop image" style=" style="display:inline-block;"">Crop media</a>
Notice how a "style" attribute is being declared within another style attribute. I've yet to test when this bug occurred but I have other sites using older versions of the module that do not have this issue.
This is on a fresh Drupal install.
Comments
Comment #1
magicmyth commentedFound the problem. imagecrop_jquery_dialog() uses l() which makes use of drupal_attributes(). However, $style is being passed the string value with 'style="..."', and thus causes a double wrapping of the HTML attribute.
Attached is a patch to fix this issue but I don't know if it will function correctly for other dialogs as I've not checked to see what they are expecting the form of $style to take.
Comment #2
Hopiu commentedThanks for the patch! At least for me it works perfectly well.
Comment #3
mstef commentedWorks
Comment #4
ianthomas_ukThanks for the patch, unfortunately I can't commit it as it's an API change and does in fact break our other implementations of that function (for colorbox and iframe), plus other custom/contrib modules could be using the API.
Here's an approach that keeps the same API and changes the internals of imagecrop_jquery_dialog instead.
Comment #5
ianthomas_ukCommitted and pushed to 7.x-1.x-dev