Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Oct 26, 2022 @ 00:25
    Mario Lopez
    0

    Custom Migration with Our Umbraco Migrations from ProWorks

    I have been trying to create a migrator for the Our Umbraco Migrations package but it doesn't even run.

    The basic structure of the class looks like this:

    [DataTypeMigrator("Imulus.UrlPicker")]
    public class ImulusUrlPickerMigrator : JsonContentMigrator<JArray>
    {
          public override string GetNewPropertyEditorAlias(IDataTypeDefinition dataType, IDictionary<string, PreValue> oldPreValues) => "Umbraco.MultiUrlPicker";
    
          protected override IEnumerable<IJsonPropertyTransform<JArray>> GetJsonPropertyTransforms(IDataTypeDefinition dataType, IDictionary<string, PreValue> oldPreValues, bool retainInvalidData)
          {
            yield return new JsonPropertyTransform<JArray>
            {
                Migration = new ImulusUrlPickerMigration(),
                PropertyValuesAndSetters = GetValuesAndSetters
            };
          }
    }
    

    Not all code is here, it also includes some code copied from the Archetype Migrator that comes with the package. The main thing is that the migrator doesn't run at all :(

    I thought this migrator should be picked up automatically by the DefaultIdToUdiMigration but apparently it's not.

    Other migrators run properly so the actual migration is running, it's just this migrator doesn't run.

    Any ideas about what I'm missing?

Please Sign in or register to post replies

Write your reply to:

Draft