Skip to content

Migrate old locallinks formats#17307

Merged
nikolajlauridsen merged 10 commits intov15/devfrom
v15/task/local-link-migration
Nov 4, 2024
Merged

Migrate old locallinks formats#17307
nikolajlauridsen merged 10 commits intov15/devfrom
v15/task/local-link-migration

Conversation

@Migaroez
Copy link
Contributor

@Migaroez Migaroez commented Oct 18, 2024

Description

One of the last remaining tasks regarding the removal of UDI leaking outside of domain logic was to clean up old locallink data.

This PR adds a migration to do just that and also tries to migrate any int based locallinks that might be present.

To do this, some temporary private methods on the HtmlLocalLinkParser had to be made public to avoid code duplication and thus they were immediately marked obsolete as well.

Extending

Package developers can add their own processors to traverse custom content within content structures until an RTE is detected to then replace the locallinks.
An example of this can be found in ConfigureConvertLocalLinkOptions.Configure
If developers for some reason would not like to migrate any data, they can use the same mechanic to remove all registered processors from the List.

Testing

Create a pre v14 database with Rich text editors, and all possible block based propertyeditors with a block that has a rich text editor in them. Create a bunch of local links in all those permutations. They should show up in the database in the old format

Then migrate all the way up to this PR and the UDI notation in locallinks should be gone from all Current and published versions of all documents.

Copy link
Contributor

@nikolajlauridsen nikolajlauridsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@nikolajlauridsen nikolajlauridsen merged commit e50a1dc into v15/dev Nov 4, 2024
@nikolajlauridsen nikolajlauridsen deleted the v15/task/local-link-migration branch November 4, 2024 11:29
nikolajlauridsen added a commit that referenced this pull request Nov 4, 2024
* Initial working localLinks migration

* Cleanup

* Refactor for extendability part 1

* Refactor part 2

* Fixed circular dependency

* Made sure all the extendable logic for the migration is marked as obsolete for v18

* Refactor to use Interface and non circular references instead

* Use Npco for SQLserver compatibility and include media properties too

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
@nikolajlauridsen
Copy link
Contributor

Cherry-picked into the release branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments