Copied to clipboard

Flag this post as spam?

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


  • Brett Spencer 88 posts 259 karma points
    Mar 19, 2021 @ 19:22
    Brett Spencer
    0

    Umbraco 7 to 8 Migration TinyMCE Changing links and Stripping img "src"

    TinyMCE has changed link href address to javascript object instead of working link AND has stripped out all of the image src urls.

    I have not found any other references to this happening to anyone other than way back during version 4 issues - which don't apply. I'm a little worried that I cannot find anyone with this same issue and known fix.

    Here is an example of the old and the new:

    Old

    <a rel="noopener noreferrer" data-udi="umb://media/54c64d58053e440d980f3f8f58a696b3" href="/media/1425/form-direct-deposit.pdf" target="_blank" title="Form - Direct Deposit.pdf">
    <img style="width: 136px; height: 122px;" src="/media/1445/bacs-form.png?width=136&amp;height=122" alt="" data-udi="umb://media/20fff2e07817448a8e42b461e193bc44" />
    

     

    New

    <a rel="noopener noreferrer" data-udi="umb://media/54c64d58053e440d980f3f8f58a696b3" href="/{localLink:umb://media/54c64d58053e440d980f3f8f58a696b3}" target="_blank" title="Form - Direct Deposit.pdf">
    <img style="width: 136px; height: 122px;" src="/?width=136&amp;height=122" alt="" data-udi="umb://media/20fff2e07817448a8e42b461e193bc44" />
    

    If I just copy and past the old code to the new, I at least get the correct link href url but the image src keeps getting stripped! I'd rather not have to copy and paste everything as the content owners have a lot of pages and info using this control.

  • Brett Spencer 88 posts 259 karma points
    Mar 24, 2021 @ 17:26
    Brett Spencer
    0

    If someone could please explain to me why the data-udi attribute is being added, that would be wonderful. This is the cause of the problem.

    When removing the data-udi attributes from both the "anchor" and "image" elements the respective elements keep their href and src urls without them being stripped upon save.

    So I am forced to overwrite all of the existing version 8 code blocks with the data-udi attributes removed from the version 7 and save and publish with success.

  • Matt 76 posts 280 karma points
    Jun 01, 2022 @ 07:12
    Matt
    0

    Thanks for the tip on removing the data-udi attributes. That worked for me also. I'm actually seeing the src attribute of an image tag being stripped on brand new umb 8 content when adding images via the RTE.

    From what I can tell the data-udi attribute is used for a couple of things: 1. on the info tab for the image in the media section you'll see which pieces of content are using that image - its likely the data-udi tag that does this as removing it breaks that functionality 2. when you click on an existing image from within the RTE it brings up that image in the picker so you can edit the alt text, etc - again I think this is due to the data-udi attribute being present

    My src attributes stri pout to src="/umbraco?width=350" and sometime to src="". I think it might be something to do with media storage in the azure blob storage as I dont see the issue on local dev.

Please Sign in or register to post replies

Write your reply to:

Draft