IE7 specific code was added to wysiwyg-media.js in #860518: Media images cannot be resized in the WYSIWYG using Internet Explorer, but this now causes errors after using a Wysiwyg editor to place an inline image in a node body:

Warning: explode() expects parameter 2 to be string, array given in media_parse_css_declarations() (line 123 of /sites/all/modules/media/includes/media.filter.inc).
Warning: array_map(): Argument #2 should be an array in media_parse_css_declarations() (line 123 of /sites/all/modules/media/includes/media.filter.inc).
Warning: Invalid argument supplied for foreach() in media_parse_css_declarations() (line 123 of /sites/all/modules/media/includes/media.filter.inc).

This is due to the following JavaScript:

        mediaAttributes.style = {
          height: imgHeight,
          width: imgWidth
        }

This sets mediaAttributes['style'] to an array, but the PHP parser only expects members of this array to be strings.

Comments

longwave’s picture

Status: Active » Needs review
StatusFileSize
new835 bytes

Attached patch fixes this for me, as I don't think the "style" property is needed at all here.

Status: Needs review » Needs work

The last submitted patch, 1393676-media-wysiwyg-ie7.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new723 bytes

Fixing paths in the patch

steinmb’s picture

Component: WYSIWYG integration » Code
Issue summary: View changes
Status: Needs review » Closed (outdated)