Skip to content

Error Migrating Variant (Multi Lingual) Content #303

@justin-nevitech

Description

@justin-nevitech

We have a multi-lingual site which we are migrating Nested Content to Block List using uSync Migrations (version 4.0.0-phase.5.1). It migrates fine when content has multiple language versions, but when content only has one language version, the migration output file is missing the culture attribute for the values and it tries to update the invariant language instead causing an error.

The problem is due to the code at the following line which assumes just because there's only one value, it is not dealing with variants.

We've made a temporary fix to change this logic which resolves the problem, but I'm not sure if this has any unwanted consequences so I've not submitted it as a PR.

    protected override IEnumerable<XElement> ConvertPropertyValue(string itemType, string contentType, XElement property, SyncMigrationContext context)
    {
        var cultures = property.Elements("Value").Attributes("Culture");

        if (cultures.Count() > 0)
        {

Hopefully this will help someone else and maybe a fix can get added. Happy to submit a PR if you think the fix is OK?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions