Node Migration: Filter By Dimension Values

Background

An obsolete, not-translated version of a site is currently occupying the alternative language dimension we eventually plan on supporting.

Intent

Remove all the nodes with a specific content dimension.

What I’ve done so far

Given this relevant portion of configuration:

Configuration/Settings.yaml

Neos:
  ContentRepository:
    contentDimensions:
      language:
        label: Language
        icon: icon-language
        default: it
        defaultPreset: it
        presets:
          it:
            label: 'Italiano'
            values:
              - it
            uriSegment: it
          en_US:
            label: 'English'
            values:
              - en_US
            uriSegment: en

I tried to create a content migration, like so:

Migrations/TYPO3CR/Version20201028095200.yaml

up:
  comments: 'Elimina i contenuti inglesi'
  migration:
    -
      filters:
        -
          type: 'DimensionValues'
          settings:
            dimensionValues: ['en_US']
      transformations:
        -
          type: 'RemoveNode'

down:
  comments: 'Impossibile annullare l''eliminazione'

The problem

Unfortunately, applying the migration doesn’t yield any result. I’m open to suggestions.

Got it. The dimensions filter requires a very specific format to work. In fact, it must match the contents of the dimensionvalues column of the neos_contentrepository_domain_model_nodedata table.

The correct settings were:

type: 'DimensionValues'
settings:
  dimensionValues:
    language: ['en_US']
1 Like