After upgrading to the most recent dev versions of Media 7.x-2.x and File Entity, the width and height attributes (set as data-width and data-height) seem to no longer be supplied by media_token_to_markup() for images inserted using the WYSIWYG module.

I tried looking for another issue on d.o that addressed this, but wasn't able to find one. I also tried to figure out why $variables['width'] and $variables['height'] seem to be NULL in theme_picture_formatter(), but I was pretty unsuccessful.

Here's a workaround patch that appears to solve my issue. I'm not sure if there are any negative side effects to this patch.

Comments

drupal_was_my_past’s picture

Status: Active » Needs review
StatusFileSize
new739 bytes

I finally tracked down the problem. The newest File Entity switches from storing data on the $file object in an array called image_dimensions to an array called metadata. This corresponds to the File Entity removing the image dimensions table in favor of the file_metadata table.

Here is a patch that will put the heights and width attributes back on images when Picture is used with the latest versions of File Entity and Media.

Cheers,
Rocket

attiks’s picture

Status: Needs review » Fixed

Patch from #1 applied, changed a bit to support both versions.

Thanks

Status: Fixed » Closed (fixed)

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

  • Commit 9b2f2a9 on 7.x-1.x, picturefill2 authored by rocket_nova, committed by attiks:
    Issue #2101779 by rocket_nova: Fixed Width and height missing in WYSIWYG...

  • Commit 9b2f2a9 on 7.x-1.x, picturefill2, 7.x-2.x authored by rocket_nova, committed by attiks:
    Issue #2101779 by rocket_nova: Fixed Width and height missing in WYSIWYG...