Copied to clipboard

Flag this post as spam?

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


  • Jamie Attwood 201 posts 493 karma points c-trib
    Oct 09, 2014 @ 00:38
    Jamie Attwood
    0

    Broken Image SRC's in RTE after upgrade to 6.2.2

    Just finished a big upgrade from 4.7.0 to 6.2.2. Despite a long, long afternoon, all is well with the exception that all images that were inserted through TinyMCE are not working. Insead of using an absolute "/" prefix, they are all referencing "~/", So what should be: "/media/myimage.png" is being outputted as "~/media/myimage.png".

    Hopefully this is a setting in one of the configs, but can't find anything.

    Any suggestions would be greatly appreciated.

    Thanks,

    Jamie

  • Jamie Attwood 201 posts 493 karma points c-trib
    Oct 09, 2014 @ 19:03
    Jamie Attwood
    100

    For anyone having this issue, I had to get into the database to clean up all the legacy broken image paths. For anyone interested, running these 4 queries did the trick. Back up your database first! First update the cmsPropertyData table which will get all the source data cleaned that is used to display content in the back office, and then you can either republish or just run the queries against cmsContentXml to get the offending "~/" and "/~" out of the actual XML. Hope that helps... 

    UPDATE cmsPropertyData
    SET dataNtext  = REPLACE(CAST(dataNtext  AS NVARCHAR(MAX)), '/~/media/', '/media/')
    WHERE  (dataNtext   LIKE '%/~/media/%')
    
    UPDATE cmsPropertyData
    SET          dataNtext  = REPLACE(CAST(dataNtext  AS NVARCHAR(MAX)), '~/media/', '/media/')
    WHERE  (dataNtext   LIKE '%~/media/%')
    
    UPDATE cmsContentXml
    SET          xml = REPLACE(CAST(xml AS NVARCHAR(MAX)), '/~/media/', '/media/')
    WHERE  (xml LIKE '%/~/media/%')
    
    UPDATE cmsContentXml
    SET          xml = REPLACE(CAST(xml AS NVARCHAR(MAX)), '~/media/', '/media/')
    WHERE  (xml LIKE '%~/media/%')
Please Sign in or register to post replies

Write your reply to:

Draft