Skip to content

Avoid throwing an exception on getting references when migrating content with changed data types (16)#20155

Merged
AndyButland merged 2 commits into
mainfrom
v16/bugfix/avoid-exception-on-get-references-after-migration
Sep 16, 2025
Merged

Avoid throwing an exception on getting references when migrating content with changed data types (16)#20155
AndyButland merged 2 commits into
mainfrom
v16/bugfix/avoid-exception-on-get-references-after-migration

Reintroduced generic catch to avoid functional breakage

5ceb9bd
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Umbraco CMS 9+ succeeded Sep 16, 2025 in 13m 57s

Build #16.3.0--rc.preview.106+ebb10ba had test failures

Details

Tests

  • Failed: 1 (0.01%)
  • Passed: 16,420 (99.57%)
  • Other: 70 (0.42%)
  • Total: 16,491

Annotations

Check failure on line 1 in can publish content with the image cropper data type

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Umbraco CMS 9+

can publish content with the image cropper data type

ContentWithImageCropper.spec.ts:52:5 can publish content with the image cropper data type
Raw output
  [chromium] › DefaultConfig\Content\ContentWithImageCropper.spec.ts:52:5 › can publish content with the image cropper data type @smoke 

    TypeError: Cannot read properties of undefined (reading 'alias')

      68 |   const contentData = await umbracoApi.document.getByName(contentName);
      69 |   expect(contentData.variants[0].state).toBe(expectedState);
    > 70 |   expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName));
         |                                ^
      71 |   expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(imageFileName));
      72 |   expect(contentData.values[0].value.crops).toEqual([]);
      73 |   expect(contentData.values[0].value.focalPoint).toEqual(defaultFocalPoint);
        at D:\a\1\s\tests\Umbraco.Tests.AcceptanceTest\tests\DefaultConfig\Content\ContentWithImageCropper.spec.ts:70:32

    attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────
    results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium\trace.zip
    Usage:

        npx playwright show-trace results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium\trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────

    Retry #1 ───────────────────────────────────────────────────────────────────────────────────────

    TypeError: Cannot read properties of undefined (reading 'alias')

      68 |   const contentData = await umbracoApi.document.getByName(contentName);
      69 |   expect(contentData.variants[0].state).toBe(expectedState);
    > 70 |   expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName));
         |                                ^
      71 |   expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(imageFileName));
      72 |   expect(contentData.values[0].value.crops).toEqual([]);
      73 |   expect(contentData.values[0].value.focalPoint).toEqual(defaultFocalPoint);
        at D:\a\1\s\tests\Umbraco.Tests.AcceptanceTest\tests\DefaultConfig\Content\ContentWithImageCropper.spec.ts:70:32

    attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────
    results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium-retry1\trace.zip
    Usage:

        npx playwright show-trace results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium-retry1\trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────

    Retry #2 ───────────────────────────────────────────────────────────────────────────────────────

    TypeError: Cannot read properties of undefined (reading 'alias')

      68 |   const contentData = await umbracoApi.document.getByName(contentName);
      69 |   expect(contentData.variants[0].state).toBe(expectedState);
    > 70 |   expect(contentData.values[0].alias).toEqual(AliasHelper.toAlias(dataTypeName));
         |                                ^
      71 |   expect(contentData.values[0].value.src).toContain(AliasHelper.toAlias(imageFileName));
      72 |   expect(contentData.values[0].value.crops).toEqual([]);
      73 |   expect(contentData.values[0].value.focalPoint).toEqual(defaultFocalPoint);
        at D:\a\1\s\tests\Umbraco.Tests.AcceptanceTest\tests\DefaultConfig\Content\ContentWithImageCropper.spec.ts:70:32

    attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────
    results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium-retry2\trace.zip
    Usage:

        npx playwright show-trace results\DefaultConfig-Content-Cont-f9e20-the-image-cropper-data-type-chromium-retry2\trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────