Kentico / xperience-by-kentico-kentico-migration-tool

A customizable tool that migrates older Kentico solutions to the latest version of Xperience by Kentico.
MIT License
5 stars 0 forks source link

Migration Toolkit doesn't handle Path Selector #214

Closed liamgold closed 1 week ago

liamgold commented 1 month ago

Brief bug description

Run the migration toolkit for a website in KX13 to Xperience by Kentico, and widget fields using Path Selector are not converted to the appropriate Xperience by Kentico equivalent.

XbyK doesn't have a Path Selector, and the recommendation is to use Page Selector.

It is expected that the Migration Toolkit should take the existing NodeAliasPath selected, convert that to the appropriate GUID in Xperience by Kentico, so that the developer can easily switch to a Page Selector with minimal effort.

liamgold commented 1 month ago

Example converted widget configuration:

{
    "identifier": "b0d32b5f-2bb3-49e2-9628-0c17efee6b19",
    "type": "Client.TabbedContentSignpost",
    "variants": [
        {
            "identifier": "dccdec62-3aed-46c1-81c0-ed9cbf9997ab",
            "properties": {
                "path": [
                    {
                        "nodeAliasPath": "/Home/Tabbed-content"
                    }
                ],
                "heading": "What can we do to help?",
                "showOnInPageNavigation": false,
                "anchorTitle": "",
                "anchor": ""
            }
        }
    ]
},
tkrch commented 1 month ago

Hi @liamgold, do you have Source instance discovery set up? It is required for widget definition migration, because it supplies information about which fields to convert and how.

liamgold commented 1 month ago

I don't think so, will this handle the conversion of Path Selector to Page Selector?

If so, I will give it another test when I get some spare time.

I couldn't see anything handling this conversion in the source code.

tkrch commented 1 month ago

@liamgold database itself doesn't contain any info on which form control is used for widget property, that is established in site code. That's why we need to read information somehow. Easiest is to use Kentico API directly from working instance (all information is available in memory, so we don't need to analyze code directly). Here you can see, that mapping will not happen if we don't know what value stored in JSON represents (without source instance discovery we can only guess what is stored insude properties)

liamgold commented 1 month ago

Yes, but the code I'm referring to which is commented out here for PathSelector, are you saying this scenario should be handled even though it is commented out?

https://github.com/Kentico/xperience-by-kentico-kentico-migration-tool/blob/5c6f427fedb7ecdb3b5468ddc0b065183865b995/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs#L832

tkrch commented 4 weeks ago

I see the issue now, page selector was previously supported in form legacy mode (no migration need). That mode was dropped from XbyK and now data are invalid.

Migration path from "Path selector" to "Page selector" is approved, i will implement it into upcoming version. I will close this issue when implementation is finished

Thanks for report!

tkrch commented 3 weeks ago

@liamgold implementation is now published in master branch, can You check if issue still persists? Thanks, TK