Jumoo / uSyncMigrations

Rough and ready migration code.
Mozilla Public License 2.0
47 stars 62 forks source link

got macro to block grid block working #183

Closed prjseal closed 1 year ago

prjseal commented 1 year ago

got macro to block grid block working when you create the doc types for the macros first.

As discussed on discord

KevinJump commented 1 year ago

Hi,

I;ve accepted this - but then I've made a minor change to this, tell me if it rings alarm bells.

instead of checking for the alias, being a specific type

        if(contentTypeAlias == "BlockElement_macro")
        {
            var macroObject = JsonConvert.DeserializeObject<MacroObject>(control.Value.ToString());

            if (macroObject != null)
            {
                contentTypeAlias = macroObject.MacroEditorAlias;
            }
        }

i am going to check to see if the grid control is infact a macro

        if(control.Editor.Alias.InvariantEquals("macro"))

that should in theory be a little bit more robust and if for some reason the converted content type for it isn't called BlockElement_macro in the future, it will still work

sound good ??

prjseal commented 1 year ago

Sounds spot on to me

KevinJump commented 1 year ago

✔️ it is done.