Migrate old locallinks formats#17307
Merged
nikolajlauridsen merged 10 commits intov15/devfrom Nov 4, 2024
Merged
Conversation
iOvergaard
reviewed
Oct 18, 2024
src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/ConvertLocalLinks.cs
Outdated
Show resolved
Hide resolved
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>
Contributor
|
Cherry-picked into the release branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ConfigureIf 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.