Problem/Motivation
The introduced media wrappers from #1970370-3: Split media token handling from WYSIWYG integration javascript make more trouble than they actually solve.
The idea was to be able to insert multiple / nested HTML-tags as media "placeholder" into a WYSIWYG editor. Unfortunately the current WYSIWYG integrations aren't capable to handle such constructs as single "element" - even worse the placeholder that was before a single HTML-tag (<img />
) consists now of multiple tags / directives (<!--MEDIA-WRAPPER-START-1--><img><!--MEDIA-WRAPPER-START-2-->
).
Another issue introduced with the mentioned patch is that updates on the placeholder element (e.g. a resize) aren't reflected in the tagmap because it always falls back to the existing tagmap item instead creating a new one (Introduced in #1970370-2: Split media token handling from WYSIWYG integration javascript).
Proposed resolution
Basic conditions:
- The placeholder element in the basic WYSIWYG integration has to be a single html-tag e.g. an image.
More complex scenarios can be achieved by using the already existing modulemedia_wysiwyg_view_mode
. - Changes on this placeholder element have to be reflected in the tagmap / in the media token that's stored.
The attached patch reverts the parts that cause the trouble and changes media_file_displays_alter()
to ensure the returned placeholder is a single html tag - at least for images.
Remaining tasks
- Figure out how we can generically ensure that a WYSIWYG placeholder is a single html tag. Shall we introduce a dedicated view mode? I think that would be more predictable.
User interface changes
none
API changes
none
Related Issues
#2067063: Wysiwyg integration is broken
#1970370: Split media token handling from WYSIWYG integration javascript
#2067325: [META] Tracking WYSIWYG compatibility
#2107465: IE removes MEDIA-WRAPPER-START comment
#2120471: TinyMCE plugin does not put the inserted image in the right place in IE
#2062659: Roll the media_wysiwyg_view_mode module into media module.
#2090979: Media once inserted via WYSIWYG cannot be delete anymore
#2116639: Multiple items inside Media tagmap variables makes it broken. (I think)
#1504696: Integration with CKEditor module
Comment | File | Size | Author |
---|---|---|---|
#2 | media-revert-wysiwyg-media-wrapper-2120997-2.patch | 5.31 KB | das-peter |
media-revert-wysiwyg-media-wrapper.patch | 5.6 KB | das-peter | |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedyes please. reverting will fix a good hunk of #2067063: Wysiwyg integration is broken
you essentially revert #2108647: Array.indexOf doesn't exist!
Comment #2
das-peter CreditAttribution: das-peter commentedOh, that's not the idea ;) Re-rolled patch attached.
Comment #3
kaidjohnson CreditAttribution: kaidjohnson commented@das-peter, we've done away with the media wrappers in #2067063: Wysiwyg integration is broken and have taken a different approach to element match & replace (no jquery, no regex). It would be great to get your input on that thread, as it should resolve this issue once complete.
Comment #3.0
kaidjohnson CreditAttribution: kaidjohnson commentedAdded another related issue.
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedthe issue linked above has more exposure, lets move on there instead