Jumoo / uSyncMigrations

Rough and ready migration code.
Mozilla Public License 2.0
44 stars 57 forks source link

Umbraco.TinyMCEv3 Rich Text Editor Internal Links Not Working #139

Open JMMM77 opened 1 year ago

JMMM77 commented 1 year ago

uSync.Migrations: 4.0.0-phase.2.1 uSync.Cms: 10.3.3 Hi,

I noticed that the RTE internal links were not working, I think its because the localLink is missing umb://document/.

I was thinking about creating my own custom migratory to fix this but I couldn't find an example that updates the value of a property in the MyMigrationProfile.cs.

Before: image

After: image

As a workaround I ran the below SQL Script to get all the pages that are using the Umbraco.TinyMCEv3 and is using "localLink:".

  Select upd.id as 'umbracoPropertyData id'
  , propertyTypeId
  , udt.propertyEditorAlias
  , cpt.Alias as 'Property Type Alias'
  , ucv.text as 'Node Name'
  , ucv.[current]
  , published
  , varcharValue
  , textValue
    from umbracoPropertyData upd 
    INNER JOIN umbracoContentVersion ucv ON upd.versionId = ucv.Id 
    INNER JOIN cmsPropertyType as cpt on cpt.id = upd.propertyTypeId
    INNER JOIN umbracoDataType as udt on cpt.dataTypeId = udt.nodeId
    INNER JOIN umbracoDocument as ud on ud.nodeId = ucv.nodeId
    WHERE  (ucv.[current] = 1 and propertyEditorAlias='Umbraco.TinyMCE' and textValue like '%href="/{localLink:%') 

Please let me know if there is a better way to go about this.

KevinJump commented 1 year ago

Hi,

I think the RichTextBoxMigrator will need expanding (at the moment it just passes values through).

overwriting the GetContentValue method from the base class would enable the migrator to find the links (via regex) and update them.

bielu commented 11 months ago

@KevinJump I think this one was already addressed 🤔

AllanMT commented 9 months ago

Yes, I had this problem earlier in the year but it seemed fixed with the latest version on November 14th