Skip to content

V15 migrations skip properties that vary by culture when the parent content type is invariant #22159

@giano574

Description

@giano574

Which Umbraco version are you using?

15.0.0

Bug summary

During the upgrade to Umbraco 15, certain migrations (e.g. ConvertLocalLinks, ConvertBlockEditorPropertiesBase, etc.) appear to skip properties that vary by culture if the parent content type itself is invariant. A warning is logged:

property data with id: {id} references a language that does not exist - language id: null (property type: "{propertyName}", id: {propertyId}, alias: "{propertyAlias}")

Specifics

The migration process erroneously detects a culture-varying property on an invariant parent content type as using a non-existing language when in reality, it is not using any language. This can happen when a composition with culture variation is added to an invariant content type.

Steps to reproduce

  1. Start with an Umbraco 13 project.
  2. Create a new composition and enable "allow vary by culture".
  3. Add a new property with alias and name "myCultureVaryingProperty".
  4. Create a new Block Grid as the editor for the property.
  5. Create a new document type that does not vary by culture.
  6. Add the new composition as a composition to the new document type.
  7. Create a new document based on the new document type and fill out "myCultureVaryingProperty".
  8. Inspect the database and observe that the values for the nested "content" property are stored without an associated language (languageId is NULL):
    SELECT 
        pd.id,
        pt.alias,
        pt.variations,
        pd.languageId,
        pd.textValue
    FROM umbracoPropertyData pd
    JOIN cmsPropertyType pt ON pd.propertyTypeId = pt.id
    WHERE 
        pt.alias = 'myCultureVaryingProperty';
  9. Upgrade the site to Umbraco 15 and run migrations.
  10. Check the logs and the migrated data (use the same SQL query as before).

Expected result / actual result

Expected result
The property data is migrated to the new v15 format.

Actual result
The migration skips this property and a warning is logged:

property data with id: {id} references a language that does not exist - language id: null (property type: "myCultureVaryingProperty", id: {propertyId}, alias: "myCultureVaryingProperty")

The property data is not migrated as expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions