I’m wondering how Umbraco handles property editors that have a new alias in Umbraco 15 without breaking the data types they are set on. I’m testing an Umbraco 15 package and how it behaves when someone updates Umbraco 13 (and the Umbraco 13 version of the package) to Umbraco 15. I’m having issues on how to let Umbraco know that the Umbraco 15 property editor is the same one as in Umbraco 13 when the alias changes. Let me explain by first showing what Umbraco does with a textbox;
Lets say I create a property on a node of the data type textstring:
Now, when upgrading this database to Umbraco 15, everything keeps working as it should, but we can see that the property editor for the Textstring is now Umb.PropertyEditorUi.TextBox.
I know that Umbraco.TextBox in the screenshot is the property editor schema, but I fail to see how Umbraco knows that the property editor with alias Umb.PropertyEditorUi.TextBox is the same editor as the Umbraco.TextBox editor in Umbraco 13. If I do the same with my own property editor, it just won’t understand it:
Don’t get me wrong, this makes sense, since the property editor in Umbraco 15 has a completely different alias of ProudNerds.PropertyEditorUi.VideoPlayer compared to proudnerds.videoplayer.editor it just doesn’t know. When I set is manually, to starts working correctly again.
I know I can just keep the property editor alias the same between Umbraco 13 and 15 and that will work, but I would have liked to update the alias to reflect the convention Umbraco is using. Also I want to know how Umbraco has fixed this issue. Or is it as simple as Umbraco running a migrations on update? Or is there any other logic for connecting the old and new property editors together? Or do I need to do something with the a property editor schema? I just don’t get that concept (yet).
Otherwise I just need to keep the aliases the same
This post caught my eye and I’ve been browsing the source code to get a better understanding of what’s going on.
In short, there are two types of alias at play here, but the most important one from a data perspective is actually the latter one Umbraco.TextBox - this is what’s called the propertyEditorSchemaAlias or the Data Type and this hasn’t actually changed between v13 and v15.
The other alias you are seeing is the UI Alias for the new back office propertyEditorUiAlias - In the manifest for the editor UI, this helps it know what the component is called.
What Nik says is correct, and in addition, this additional property editor ui alias is applied through one of the 14.0.0 migrations - specifically this one:
You could add a package migration to include your own adaptation of this, if you wanted.