Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-11206

Migration issue with richtext images from other contents

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 4.5.3, 4.5.4, 4.6.0
    • None
    • None
    • None
    • 4.6 M2

      This script in 4.4 will list local images that were link to another content than their own

      We supposed that should not happen, but it totally can by copy/paste a richtext during edition

        const refs = Repository.query("//element(local, ametys:reference)", false)
        while (refs.hasNext())
        {
             const ref = refs.next();
          
          const contentNode = ref.getParent().getParent().getParent();
             const values = ref.getProperty("ametys:reference").getValues()
             for (const value of values)
             {
               if (!value.getString().includes("://" + contentNode.getId() + "@"))
               {
                 print (contentNode.getId() + " " + value.getString())
               }         
             }
        }

            cbayle Caroline Bayle
            raphael Raphaël Franchet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: