Migrations: Handles rich text blocks created with TinyMCE in convert local links migration and refreshes internal datatype cache following migration requiring cache rebuild (closes #20885) #20887
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.
Prerequisites
Addresses: #20885
Description
This PR contains two updates to address issues found in testing the database provided illustrating the problem encountered in the linked issue.
The most important is the report of block data from blocks in the RTE being removed after the upgrade. I tracked this down to the
ConvertLocalLinksmigration, which requires serializing the rich text content. As in the 13 the layout values key is"Umbraco.TinyMCE"rather than"Umbraco.RichText", these are omitted, and an empty block value is returned. I've resolved that by supporting this key as well, such that the existing values will be read.The second fix is that I noticed that after the migration, when accessing certain content, an error of being unable to find a data type by Id is thrown. This was referring to one of the data types added in a migration - the "Label (pixels)" one. Although we clear caches after the migration completes, there's an internal cache of datatypes in
PublishedContentTypeFactorythat isn't cleared. So I've added a means of doing that and executed it along with the other post-migration cache invalidations.Point to note
In testing this I've also seen that the markup will get encoded via this
ConvertLocalLinksmigration, so starting from:We end up with:
It doesn't seem to cause any issues, but wanted to flag in case this jumps out as a concern.
Testing
I've been working with a customer database that I could share, but I would expect this would be an issue you could see if you follow these steps:
mainorrelease/16.4and I'd expect you would see the block information lost after Umbraco starts and the migration completes.