Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John 79 posts 115 karma points
    Aug 07, 2014 @ 17:40
    John
    0

    Inserting an image into tinymce is broken (inserts an empty <img/> element)

    We're using Umbraco 6.1.6 and I've just noticed an issue with TinyMce.  If I use the normal image button to insert an image, and select one from the media library, when I click the "Insert" button the dialog disappears but no image is inserted.

    If I then save and look in the database, I can see that it's inserted in but with no src element.

    I've tried this on existing and new pages, and also on existing and new images and it seems to happen for everything.

    Some of our existing content has embedded images in them and they continue to display even after a publish.  So I don't *think* it's the tinymce config's validElements.  However, it looks correct as far as I can see.  I'll paste it in at the end just in case.

    The only other thing I'm wondering about if it's something to do with crops.  We have a 4.7.2 site at the moment (and are just about to launch the 6.1.6 version) and it works OK.  But it uses crops whereas we don't use them now as they take up too much disk space.

    I'm really not sure where to start debugging this problem.  There are no JS errors being written to the console or anything like that.

    Can anyone point me in the right direction?

    Thanks!

    John

    PS - tinymce valid elements as follows:


            img[dir|lang|longdesc|usemap|class|src|alt=|title|width|height|umbracoorgwidth|umbracoorgheight|rel],-q,
    -blockquote[dir],-table[class|summary|dir|lang],-tr[lang|dir|class|rowspan],tbody[class],-br,
    thead[class],tfoot[class],+td[lang|dir|class|colspan|rowspan|scope],sub[class],sup[class],
    -th[lang|dir|class|colspan|rowspan|scope],caption[lang|dir|class],-div[dir|class],
    -span[!class],-h1[dir|class],-h2[dir|class],
    -h3[dir|class],-h4[dir|class],-h5[dir|class],-h6[dir|class],
    dd[class|dir|lang],dl[class|dir|lang],dt[class|dir|lang],
    param[name|value|_value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,-sup,-sub ]]>

  • John 79 posts 115 karma points
    Aug 08, 2014 @ 09:49
    John
    0

    I think I've got it..... just needed to sleep on it and clear the head I think.

    I rolled back my tinymce config to the one out of the box and it worked, and using the power of trial and error I discovered it IS the valid elements list that's causing the problem.

    The img element needs to be allowed an ID attribute like this:

    img[id|dir|lang|longdesc|usemap|class|src|alt=|title|width|height|umbracoorgwidth|umbracoorgheight|rel],

    That seems to have done the trick.  I'm guessing it must be a change in Umbraco 6.x as we didn't need that attribute in the previous version.  Phew - panic over!

Please Sign in or register to post replies

Write your reply to:

Draft